From ac0a9659d1c86e9c0b4234a16486e084bcb0a555 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 22 Jul 2016 11:13:33 +0300 Subject: upgrade: improve self upgrade functionality a bit trigger it only if apk-tools can be upgrade, add test cases --- test/selfupgrade.repo | 37 +++++++++++++++++++++++++++++++++++++ test/selfupgrade1.installed | 18 ++++++++++++++++++ test/selfupgrade1.test | 10 ++++++++++ test/selfupgrade2.installed | 12 ++++++++++++ test/selfupgrade2.test | 11 +++++++++++ test/selfupgrade3.installed | 18 ++++++++++++++++++ test/selfupgrade3.test | 7 +++++++ test/selfupgrade4.test | 7 +++++++ test/solver.sh | 2 +- 9 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 test/selfupgrade.repo create mode 100644 test/selfupgrade1.installed create mode 100644 test/selfupgrade1.test create mode 100644 test/selfupgrade2.installed create mode 100644 test/selfupgrade2.test create mode 100644 test/selfupgrade3.installed create mode 100644 test/selfupgrade3.test create mode 100644 test/selfupgrade4.test (limited to 'test') diff --git a/test/selfupgrade.repo b/test/selfupgrade.repo new file mode 100644 index 0000000..44a7ca2 --- /dev/null +++ b/test/selfupgrade.repo @@ -0,0 +1,37 @@ +C:Q1EyN512pAOBJWKMR89pp/C66o+OE= +P:apk-tools +V:1 +S:1 +I:1 +D:libcrypto + +C:Q1EyN534pAOBJWKMR89pp/CFFo+OF= +P:apk-tools +V:2 +S:1 +I:1 +D:libcrypto>=2 + +C:Q1eVpk56fqZAukAXFYbgwt4xAEEEe= +P:libcrypto +V:1 +S:1 +I:1 + +C:Q1eVpka78qZAukAXFYbgwt4xAEFFe= +P:libcrypto +V:2 +S:1 +I:1 + +C:Q1EyN5A77AOBJWKMR89pp/CFFo+OE= +P:application +V:1 +S:1 +I:1 + +C:Q1EyN5A55AOBJWKMR89pp/CFFF+OE= +P:application +V:2 +S:1 +I:1 diff --git a/test/selfupgrade1.installed b/test/selfupgrade1.installed new file mode 100644 index 0000000..5a7b052 --- /dev/null +++ b/test/selfupgrade1.installed @@ -0,0 +1,18 @@ +C:Q1EyN512pAOBJWKMR89pp/C66o+OE= +P:apk-tools +V:1 +S:1 +I:1 +D:libcrypto + +C:Q1eVpk56fqZAukAXFYbgwt4xAEEEe= +P:libcrypto +V:1 +S:1 +I:1 + +C:Q1EyN5A77AOBJWKMR89pp/CFFo+OE= +P:application +V:1 +S:1 +I:1 diff --git a/test/selfupgrade1.test b/test/selfupgrade1.test new file mode 100644 index 0000000..8afa133 --- /dev/null +++ b/test/selfupgrade1.test @@ -0,0 +1,10 @@ +@ARGS +--test-repo selfupgrade.repo +--test-instdb selfupgrade1.installed +--test-world "apk-tools application" +--self-upgrade-only +upgrade +@EXPECT +Upgrading critical system libraries and apk-tools: +(1/2) Upgrading libcrypto (1 -> 2) +(2/2) Upgrading apk-tools (1 -> 2) diff --git a/test/selfupgrade2.installed b/test/selfupgrade2.installed new file mode 100644 index 0000000..1b0d0c8 --- /dev/null +++ b/test/selfupgrade2.installed @@ -0,0 +1,12 @@ +C:Q1EyN534pAOBJWKMR89pp/CFFo+OF= +P:apk-tools +V:2 +S:1 +I:1 +D:libcrypto>=2 + +C:Q1eVpka78qZAukAXFYbgwt4xAEFFe= +P:libcrypto +V:2 +S:1 +I:1 diff --git a/test/selfupgrade2.test b/test/selfupgrade2.test new file mode 100644 index 0000000..f0ca054 --- /dev/null +++ b/test/selfupgrade2.test @@ -0,0 +1,11 @@ +@ARGS +--test-repo selfupgrade.repo +--test-instdb selfupgrade1.installed +--test-world apk-tools +--self-upgrade-only +upgrade +@EXPECT +Upgrading critical system libraries and apk-tools: +(1/3) Purging application (1) +(2/3) Upgrading libcrypto (1 -> 2) +(3/3) Upgrading apk-tools (1 -> 2) diff --git a/test/selfupgrade3.installed b/test/selfupgrade3.installed new file mode 100644 index 0000000..701d3de --- /dev/null +++ b/test/selfupgrade3.installed @@ -0,0 +1,18 @@ +C:Q1EyN534pAOBJWKMR89pp/CFFo+OF= +P:apk-tools +V:2 +S:1 +I:1 +D:libcrypto>=2 + +C:Q1eVpka78qZAukAXFYbgwt4xAEFFe= +P:libcrypto +V:2 +S:1 +I:1 + +C:Q1EyN5A55AOBJWKMR89pp/CFFF+OE= +P:application +V:2 +S:1 +I:1 diff --git a/test/selfupgrade3.test b/test/selfupgrade3.test new file mode 100644 index 0000000..ec266d9 --- /dev/null +++ b/test/selfupgrade3.test @@ -0,0 +1,7 @@ +@ARGS +--test-repo selfupgrade.repo +--test-instdb selfupgrade2.installed +--test-world "apk-tools application" +--self-upgrade-only +upgrade +@EXPECT diff --git a/test/selfupgrade4.test b/test/selfupgrade4.test new file mode 100644 index 0000000..1b941ef --- /dev/null +++ b/test/selfupgrade4.test @@ -0,0 +1,7 @@ +@ARGS +--test-repo selfupgrade.repo +--test-instdb selfupgrade3.installed +--test-world "apk-tools" +--self-upgrade-only +upgrade +@EXPECT diff --git a/test/solver.sh b/test/solver.sh index 8c27d8f..bc230c6 100755 --- a/test/solver.sh +++ b/test/solver.sh @@ -4,7 +4,7 @@ get_block() { awk '/^@'$1'/{p=1;next} /^@/{p=0} p{print}' } -APK_TEST=../src/apk-test +APK_TEST="../src/apk-test" TEST_TO_RUN="$@" fail=0 -- cgit v1.2.3-70-g09d2