diff options
author | PMR <pmr@pmr-lander> | 2020-02-13 13:48:48 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2020-02-13 13:48:48 +0000 |
commit | de6e5adb37d39bef1b9b7323505bb6adcb2cc8d2 (patch) | |
tree | 4534b413170acda83f3fcc0762e6fa2e525282f9 | |
parent | 03c65ccf739e1c2c89968061439eac94fd560306 (diff) | |
parent | 3dd58a0cdffd3061451b5fbcb240998b5a4348e8 (diff) |
Merge #378969 from ~jocave/plainbox-provider-checkbox:snap-install-base-runtime
-rwxr-xr-x | bin/snap_tests.py | 15 |
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() |