From a6a4f78e1ed7eb4868f21047b60e32d311a37052 Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Thu, 31 Oct 2019 11:06:32 +0100 Subject: [PATCH] tests/staged-deploy: test --keep-previous option Signed-off-by: Rafael Fonseca --- tests/kolainst/destructive/staged-deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/kolainst/destructive/staged-deploy.sh b/tests/kolainst/destructive/staged-deploy.sh index 0068ed5617..b17771fb74 100755 --- a/tests/kolainst/destructive/staged-deploy.sh +++ b/tests/kolainst/destructive/staged-deploy.sh @@ -29,7 +29,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in systemctl show -p SubState ostree-finalize-staged.path | grep -q waiting systemctl show -p ActiveState ostree-finalize-staged.service | grep -q inactive systemctl show -p TriggeredBy ostree-finalize-staged.service | grep -q path - ostree admin deploy --stage staged-deploy | tee out.txt + ostree admin deploy --stage --retain-previous-version staged-deploy | tee out.txt assert_file_has_content out.txt 'test-staged-path: Not running' systemctl show -p SubState ostree-finalize-staged.path | grep running systemctl show -p ActiveState ostree-finalize-staged.service | grep active @@ -59,6 +59,10 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in # And there should not be a staged deployment test '!' -f /run/ostree/staged-deployment + # Check that previous version was kept + ostree admin status > status.txt + test $(grep -Fce 'Version: ' status.txt) == 1 + # Upgrade with staging test '!' -f /run/ostree/staged-deployment ostree admin deploy --stage staged-deploy