Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Adding new data set to query Sonic OS version.#50

Merged
pra-moh merged 3 commits intosonic-net:masterfrom
macikgozwa:nondb-osversion
Dec 3, 2020
Merged

Adding new data set to query Sonic OS version.#50
pra-moh merged 3 commits intosonic-net:masterfrom
macikgozwa:nondb-osversion

Conversation

@macikgozwa
Copy link
Copy Markdown
Contributor

@macikgozwa macikgozwa commented Nov 22, 2020

Adding new data set to query Sonic OS version. This new data set can be queried with osversion/build.

The source of the data is a system configuration file that found at /etc/sonic/sonic_version.yml. An example content:

build_version: '20191130.52'
debian_version: '9.13'
kernel_version: '4.9.0-11-2-amd64'
asic_type: broadcom
commit_id: 'e59ec8291'
build_date: Mon Nov  2 03:10:49 UTC 2020
build_number: 72
built_by: sonicbld@jenkins-slave-phx-2

However, currently only build_version field from that file is included in the GNMI response. Other fields can be added easily when they are needed.

If the file is not found or cannot be parsed, the output would contain error message (see the last example below). This field would be empty otherwise.

See example outputs for the GNMI query:

Comment thread gnmi_server/server_test.go
Comment thread sonic_data_client/non_db_client.go
@pra-moh pra-moh merged commit 05c8ddd into sonic-net:master Dec 3, 2020
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Dec 15, 2020
…2578)

Adding a new test case to validate the osversion/build telemetry query. This is a new query to get the Sonic build version from the telemetry service. Details of the changes on telemetry service can be found in this PR: sonic-net/sonic-telemetry#50

What is the motivation for this PR?
A test case needed to cover a recently added telemetry service feature.

How did you do it?
The test case runs the mentioned query and checks the existence of expected keywords in the response.

How did you verify/test it?
Using Sonic KVM testbed.

Co-authored-by: Murat <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants