summaryrefslogtreecommitdiff
path: root/tests
diff options
authorGustavo Niemeyer <gustavo@niemeyer.net>2016-08-31 10:30:58 -0300
committerGitHub <noreply@github.com>2016-08-31 10:30:58 -0300
commit96c1817c216e45092cb34d2244541096cfaf0e4c (patch)
tree0c97b2014db1fdd8fd87bf7bd014e21daab3f72b /tests
parent84dcb6347b41e96a9375da0f84015043c5621068 (diff)
parentfb1b20b18d75354887293f82267692911173c277 (diff)
Merge pull request #1736 from mvo5/feature/spread-tests-porting
tests: port integration tests to spread
Diffstat (limited to 'tests')
-rw-r--r--tests/main/ubuntu-core-update-rollback-stresstest/task.yaml50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/main/ubuntu-core-update-rollback-stresstest/task.yaml b/tests/main/ubuntu-core-update-rollback-stresstest/task.yaml
new file mode 100644
index 0000000000..5d009b822d
--- /dev/null
+++ b/tests/main/ubuntu-core-update-rollback-stresstest/task.yaml
@@ -0,0 +1,50 @@
+summary: Run update/rollback tests
+systems: [ubuntu-core-16-64]
+restore: |
+ rm -f nextBoot
+execute: |
+ wait_boot_ok() {
+ echo "Waiting for boot-ok to finish"
+ while ! systemctl status snapd.boot-ok|grep SUCCESS; do
+ sleep 1
+ done
+ }
+ check_boot() {
+ grub-editenv list | grep "snap_core=ubuntu-core_$(cat nextBoot).snap"
+ }
+ store_next_boot() {
+ snap list|grep ubuntu-core|tr -s " "|cut -f3 -d' ' > nextBoot
+ }
+ echo "Install/revert a couple of times and see if stuff breaks"
+ if [ "$SPREAD_REBOOT" = "0" ]; then
+ snap list|grep ubuntu-core|tr -s " "|cut -f3 -d' ' > firstBoot
+ snap install /var/lib/snapd/snaps/ubuntu-core_$(cat firstBoot).snap
+ store_next_boot
+ REBOOT
+ fi
+ if [ "$SPREAD_REBOOT" = "1" ]; then
+ wait_boot_ok
+ check_boot
+ snap revert ubuntu-core
+ store_next_boot
+ REBOOT
+ fi
+ if [ "$SPREAD_REBOOT" = "2" ]; then
+ wait_boot_ok
+ check_boot
+ snap install /var/lib/snapd/snaps/ubuntu-core_$(cat firstBoot).snap
+ store_next_boot
+ REBOOT
+ fi
+ if [ "$SPREAD_REBOOT" = "3" ]; then
+ wait_boot_ok
+ check_boot
+ snap revert ubuntu-core
+ store_next_boot
+ REBOOT
+ fi
+ if [ "$SPREAD_REBOOT" = "4" ]; then
+ wait_boot_ok
+ check_boot
+ grub-editenv list | grep "snap_core=ubuntu-core_$(cat firstBoot).snap"
+ fi