summaryrefslogtreecommitdiff
diff options
-rwxr-xr-xbin/snap_tests.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/snap_tests.py b/bin/snap_tests.py
index f548db8..fe80288 100755
--- a/bin/snap_tests.py
+++ b/bin/snap_tests.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright 2015-2019 Canonical Ltd.
+# Copyright 2015-2020 Canonical Ltd.
# All rights reserved.
#
# Written by:
@@ -15,7 +15,16 @@ from checkbox_support.snap_utils.snapd import Snapd
# - the snap must not be installed at the start of the nested test plan
# - the snap must be strictly confined (no classic or devmode flags)
# - there must be different revisions on the stable & edge channels
-TEST_SNAP = os.getenv('TEST_SNAP', 'test-snapd-tools')
+try:
+ TEST_SNAP = os.environ['TEST_SNAP']
+except KeyError:
+ runtime = os.getenv('CHECKBOX_RUNTIME', '/snap/checkbox/current')
+ if 'checkbox18' in runtime:
+ TEST_SNAP = 'test-snapd-tools-core18'
+ elif 'checkbox20' in runtime:
+ TEST_SNAP = 'test-snapd-tools-core20'
+ else:
+ TEST_SNAP = 'test-snapd-tools'
SNAPD_TASK_TIMEOUT = int(os.getenv('SNAPD_TASK_TIMEOUT', 30))
SNAPD_POLL_INTERVAL = int(os.getenv('SNAPD_POLL_INTERVAL', 1))
@@ -60,7 +69,7 @@ class SnapInstall():
parser.add_argument('channel', help='channel to install from')
args = parser.parse_args(sys.argv[2:])
print('Install {}...'.format(TEST_SNAP))
- s = Snapd(SNAPD_TASK_TIMEOUT, SNAPD_POLL_INTERVAL)
+ s = Snapd(SNAPD_TASK_TIMEOUT, SNAPD_POLL_INTERVAL, verbose=True)
s.install(TEST_SNAP, args.channel)
print('Confirm in snap list...')
data = s.list()