summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/check-qemu-install19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index dc4bdd31..4eb5dd16 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -44,6 +44,7 @@ import logging
import re
import tomli
import shutil
+import json
from io import BytesIO
from datetime import datetime
@@ -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.
@@ -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}"')