Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsuite: T6999: validate content of /etc/os-release in target system #876

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions scripts/check-qemu-install
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import logging
import re
import tomli
import shutil
import json

from io import BytesIO
from datetime import datetime
Expand Down Expand Up @@ -97,9 +98,17 @@ parser.add_argument('--qemu-cmd', help='Only generate QEMU launch command',

args = parser.parse_args()

# This is what we requested the build to contain
with open('data/defaults.toml', 'rb') as f:
vyos_defaults = tomli.load(f)

# This is what we got from the build
with open('build/manifest.json', 'rb') as f:
manifest = json.load(f)

vyos_version = manifest['build_config']['version']
vyos_codename = manifest['build_config']['debian_distribution']

class StreamToLogger(object):
"""
Fake file-like stream object that redirects writes to a logger instance.
Expand Down Expand Up @@ -538,6 +547,16 @@ try:
c.expect('kvm')
c.expect(op_mode_prompt)

#################################################
# Verify /etc/os-release via lsb_release
#################################################
c.sendline('lsb_release --short --id 2>/dev/null')
c.expect('VyOS')
c.sendline('lsb_release --short --release 2>/dev/null')
c.expect(vyos_version)
c.sendline('lsb_release --short --codename 2>/dev/null')
c.expect(vyos_codename)

# Ensure ephemeral key is loaded
vyos_kernel_key = 'VyOS build time autogenerated kernel key'
c.sendline(f'show log kernel | match "{vyos_kernel_key}"')
Expand Down
Loading