mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
tests: new store-state tool (#12575)
* New store-state tool This is the new store tool inclusing a new test. Also it is included a network-state tool Still missing some parts of the test and a new test for the network state tool. This can be added in a following pr including the migration from the network-state helper to the new tool in all the tests * Fix wording in comment * Squashed 'tests/lib/external/snapd-testing-tools/' changes from 49f30b6a47..92bb6a0664 92bb6a0664 Include snap-sufix in the snaps.name tool 1c8efb77e1 Update default values for wait-for reboot git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 92bb6a066478a46018297e23a409ec01fb682b37 * update tools using lower case vars and scoped vars * Squashed 'tests/lib/external/snapd-testing-tools/' changes from 92bb6a0664..89b9eb5301 89b9eb5301 Update systems supported git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 89b9eb5301b6b8021e42d71162a7d4860279ad0b * Squashed 'tests/lib/external/snapd-testing-tools/' changes from 89b9eb5301..a7164fba07 a7164fba07 remove fedora 35 support, add fedora 37 support git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: a7164fba070cb36fce40714b9a5c84f35867495b * Squashed 'tests/lib/external/snapd-testing-tools/' changes from a7164fba07..3232c5dba7 3232c5dba7 Add support for ubuntu 23.04 git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 3232c5dba768f226213bfaec56bced7c384f140f * new lines * Squashed 'tests/lib/external/snapd-testing-tools/' changes from 3232c5dba7..d90935d2a4 d90935d2a4 A comment explaining about the default values for wait-for git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: d90935d2a4000bd17c7a8a2754adb66f8234bb9b * skip ubuntu trusty for store-state test because systemd-run is not supported * Fix systems for store-state test
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# The default values have been selected trying to match with most of
|
||||
# the wait times in the tests and also trying to follow common sense.
|
||||
DEFAULT_WAIT_FOR_SSH_ATTEMPTS=800
|
||||
DEFAULT_WAIT_FOR_SSH_WAIT=1
|
||||
DEFAULT_WAIT_FOR_NO_SSH_ATTEMPTS=200
|
||||
|
||||
+3
-2
@@ -17,11 +17,12 @@ backends:
|
||||
- ubuntu-20.04-64:
|
||||
- ubuntu-22.04-64:
|
||||
- ubuntu-22.10-64:
|
||||
- ubuntu-23.04-64:
|
||||
- debian-10-64:
|
||||
- debian-11-64:
|
||||
- debian-sid-64:
|
||||
- fedora-35-64:
|
||||
- debian-sid-64:
|
||||
- fedora-36-64:
|
||||
- fedora-37-64:
|
||||
- arch-linux-64:
|
||||
- amazon-linux-2-64:
|
||||
storage: preserve-size
|
||||
|
||||
@@ -76,6 +76,12 @@ execute: |
|
||||
! os.query is-ubuntu 21.04
|
||||
! os.query is-core
|
||||
;;
|
||||
ubuntu-23.04-64)
|
||||
os.query is-classic
|
||||
os.query is-ubuntu 23.04
|
||||
! os.query is-ubuntu 21.04
|
||||
! os.query is-core
|
||||
;;
|
||||
debian-10-64)
|
||||
os.query is-debian
|
||||
os.query is-debian 10
|
||||
@@ -99,16 +105,16 @@ execute: |
|
||||
os.query is-classic
|
||||
! os.query is-core
|
||||
;;
|
||||
fedora-35-64)
|
||||
fedora-36-64)
|
||||
os.query is-fedora
|
||||
os.query is-fedora 35
|
||||
os.query is-fedora 36
|
||||
! os.query is-fedora rawhide
|
||||
os.query is-classic
|
||||
! os.query is-core
|
||||
;;
|
||||
fedora-36-64)
|
||||
fedora-37-64)
|
||||
os.query is-fedora
|
||||
os.query is-fedora 36
|
||||
os.query is-fedora 37
|
||||
! os.query is-fedora rawhide
|
||||
os.query is-classic
|
||||
! os.query is-core
|
||||
|
||||
@@ -10,4 +10,16 @@ execute: |
|
||||
test -z "$(snaps.name kernel)"
|
||||
test "$(snaps.name core)" = "core"
|
||||
|
||||
if os.query is-core18; then
|
||||
test "$(snaps.name snap-sufix)" = "-core18"
|
||||
elif os.query is-core20; then
|
||||
test "$(snaps.name snap-sufix)" = "-core20"
|
||||
elif os.query is-core22; then
|
||||
test "$(snaps.name snap-sufix)" = "-core22"
|
||||
elif os.query is-core24; then
|
||||
test "$(snaps.name snap-sufix)" = "-core24"
|
||||
else
|
||||
test -z "$(snaps.name snap-sufix)"
|
||||
fi
|
||||
|
||||
snaps.name my-snap 2>&1 | MATCH "snaps.name: unknown snap my-snap"
|
||||
|
||||
+17
-1
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
show_help() {
|
||||
echo "usage: snaps.name gadget, kernel, core"
|
||||
echo "usage: snaps.name gadget, kernel, core, snap-suffix"
|
||||
echo ""
|
||||
echo "get the name of a specific snap for the current system"
|
||||
}
|
||||
@@ -25,6 +25,18 @@ core_name(){
|
||||
echo "$core_name"
|
||||
}
|
||||
|
||||
snap_suffix(){
|
||||
if os.query is-core18; then
|
||||
echo "-core18"
|
||||
elif os.query is-core20; then
|
||||
echo "-core20"
|
||||
elif os.query is-core22; then
|
||||
echo "-core22"
|
||||
elif os.query is-core24; then
|
||||
echo "-core24"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ $# -eq 0 ]; then
|
||||
show_help
|
||||
@@ -49,6 +61,10 @@ main() {
|
||||
core_name
|
||||
exit
|
||||
;;
|
||||
snap-suffix)
|
||||
snap_suffix
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "snaps.name: unknown snap $1" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user