diff --git a/Makefile.am b/Makefile.am index f78dc29b..6391bb46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -158,58 +158,58 @@ BATS = \ test/functional/search/search-content-check-negative.bats \ test/functional/search/search-content-check-positive.bats \ test/functional/search/search-client-certificate.bats \ - test/functional/update/apply-full-file-delta/test.bats \ - test/functional/update/boot-file/test.bats \ - test/functional/update/boot-skip/test.bats \ - test/functional/update/delta-without-rename-flag/test.bats \ - test/functional/update/download/test.bats \ - test/functional/update/include/test.bats \ - test/functional/update/include-old-bundle/test.bats \ - test/functional/update/include-old-bundle-with-tracked-file/test.bats \ - test/functional/update/missing-os-core/test.bats \ - test/functional/update/newest-deleted/test.bats \ - test/functional/update/newest-ghosted/test.bats \ - test/functional/update/rename/test.bats \ - test/functional/update/rename-ghosted/test.bats \ - test/functional/update/skip-scripts/test.bats \ - test/functional/update/skip-verified-fullfiles/test.bats \ - test/functional/update/status/test.bats \ - test/functional/update/status-no-server-content/test.bats \ - test/functional/update/status-no-target-content/test.bats \ - test/functional/update/status-version-double-quote/test.bats \ - test/functional/update/status-version-single-quote/test.bats \ - test/functional/update/use-full-file/test.bats \ - test/functional/update/use-pack/test.bats \ - test/functional/update/verify-fix-path-hash-mismatch/test.bats \ - test/functional/update/verify-fix-path-missing-dir/test.bats \ - test/functional/update/verify-fullfile-hash/test.bats \ - test/functional/update/re-update-required/test.bats \ - test/functional/update/re-update-bad-os-release/test.bats \ - test/functional/update/slow-server/test.bats \ - test/functional/update/statedir-bad-hash/test.bats \ - test/functional/update_v2/update-client-certificate.bats \ - test/functional/verify/add-missing-directory/test.bats \ - test/functional/verify/add-missing-include/test.bats \ - test/functional/verify/add-missing-include-old/test.bats \ - test/functional/verify/boot-file-deleted/test.bats \ - test/functional/verify/boot-file-mismatch/test.bats \ - test/functional/verify/boot-file-mismatch-fix/test.bats \ - test/functional/verify/boot-skip/test.bats \ - test/functional/verify/check-missing-directory/test.bats \ - test/functional/verify/directory-tree-deleted/test.bats \ - test/functional/verify/empty-dir-deleted/test.bats \ - test/functional/verify/fix-version-mismatch/test.bats \ - test/functional/verify/fix-version-mismatch-override/test.bats \ - test/functional/verify/format-mismatch/test.bats \ - test/functional/verify/format-mismatch-override/test.bats \ - test/functional/verify/ghosted/test.bats \ - test/functional/verify/install-directory/test.bats \ - test/functional/verify/install-latest-directory/test.bats \ - test/functional/verify/latest-missing/test.bats \ - test/functional/verify/picky-ghosted/test.bats \ - test/functional/verify/picky-ghosted-missing/test.bats \ - test/functional/verify/skip-scripts/test.bats \ - test/functional/verify_v2/verify-client-certificate.bats + test/functional/update/update-apply-full-file-delta.bats \ + test/functional/update/update-boot-file.bats \ + test/functional/update/update-boot-skip.bats \ + test/functional/update/update-client-certificate.bats \ + test/functional/update/update-delta-without-rename-flag.bats \ + test/functional/update/update-download.bats \ + test/functional/update/update-include.bats \ + test/functional/update/update-include-old-bundle.bats \ + test/functional/update/update-include-old-bundle-with-tracked-file.bats \ + test/functional/update/update-missing-os-core.bats \ + test/functional/update/update-newest-deleted.bats \ + test/functional/update/update-newest-ghosted.bats \ + test/functional/update/update-rename.bats \ + test/functional/update/update-rename-ghosted.bats \ + test/functional/update/update-re-update-bad-os-release.bats \ + test/functional/update/update-re-update-required.bats \ + test/functional/update/update-skip-scripts.bats \ + test/functional/update/update-skip-verified-fullfiles.bats \ + test/functional/update/update-slow-server.bats \ + test/functional/update/update-statedir-bad-hash.bats \ + test/functional/update/update-status.bats \ + test/functional/update/update-status-no-server-content.bats \ + test/functional/update/update-status-no-target-content.bats \ + test/functional/update/update-status-version-double-quote.bats \ + test/functional/update/update-status-version-single-quote.bats \ + test/functional/update/update-use-full-file.bats \ + test/functional/update/update-use-pack.bats \ + test/functional/update/update-verify-fix-path-hash-mismatch.bats \ + test/functional/update/update-verify-fix-path-missing-dir.bats \ + test/functional/update/update-verify-fullfile-hash.bats \ + test/functional/verify/verify-add-missing-directory.bats \ + test/functional/verify/verify-add-missing-include.bats \ + test/functional/verify/verify-add-missing-include-old.bats \ + test/functional/verify/verify-boot-file-deleted.bats \ + test/functional/verify/verify-boot-file-mismatch.bats \ + test/functional/verify/verify-boot-file-mismatch-fix.bats \ + test/functional/verify/verify-boot-skip.bats \ + test/functional/verify/verify-check-missing-directory.bats \ + test/functional/verify/verify-client-certificate.bats + test/functional/verify/verify-directory-tree-deleted.bats \ + test/functional/verify/verify-empty-dir-deleted.bats \ + test/functional/verify/verify-fix-version-mismatch.bats \ + test/functional/verify/verify-fix-version-mismatch-override.bats \ + test/functional/verify/verify-format-mismatch.bats \ + test/functional/verify/verify-format-mismatch-override.bats \ + test/functional/verify/verify-ghosted.bats \ + test/functional/verify/verify-install-directory.bats \ + test/functional/verify/verify-install-latest-directory.bats \ + test/functional/verify/verify-latest-missing.bats \ + test/functional/verify/verify-picky-ghosted.bats \ + test/functional/verify/verify-picky-ghosted-missing.bats \ + test/functional/verify/verify-skip-scripts.bats dist_check_SCRIPTS = $(BATS) # Must be run before all other tests diff --git a/test/functional/update/apply-full-file-delta/lines-checked b/test/functional/update/apply-full-file-delta/lines-checked deleted file mode 100644 index 46230ee0..00000000 --- a/test/functional/update/apply-full-file-delta/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Extracting os-core pack for version 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/apply-full-file-delta/target-dir/usr/lib/os-release b/test/functional/update/apply-full-file-delta/target-dir/usr/lib/os-release deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/update/apply-full-file-delta/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/update/apply-full-file-delta/test.bats b/test/functional/update/apply-full-file-delta/test.bats deleted file mode 100755 index 53ea1ba1..00000000 --- a/test/functional/update/apply-full-file-delta/test.bats +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -deltafile="10-100-0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962-9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - chown_root "$DIR/web-dir/100/delta/$deltafile" - cp "$DIR/web-dir/10/staged/0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962" "$DIR/target-dir/testfile" - chown_root "$DIR/target-dir/testfile" - mkdir -p "$DIR/web-dir/100/staged" - tar -C "$DIR/web-dir/100" -cf "$DIR/web-dir/100/pack-os-core-from-10.tar" delta/$deltafile staged/ -} - -teardown() { - clean_tars 10 - clean_tars 100 - rmdir "$DIR/web-dir/100/staged" - revert_chown_root "$DIR/web-dir/100/delta/$deltafile" - sudo rm "$DIR/target-dir/testfile" -} - -@test "update use delta pack" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - check_lines "$output" - - run sudo sh -c "$SWUPD hashdump $DIR/target-dir/testfile" - - [ "$status" -eq 0 ] - echo "$output" - [ "${lines[1]}" = "9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.MoM b/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.MoM deleted file mode 100644 index 04b97010..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... dbdba26e0552fdd75b5775fe6c08bae44ea2f73d6b039b598e8a031a14ab90cc 10 os-core diff --git a/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.os-core b/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.os-core deleted file mode 100644 index 75da6138..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962 10 /testfile diff --git a/test/functional/update/apply-full-file-delta/web-dir/10/staged/0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962 b/test/functional/update/apply-full-file-delta/web-dir/10/staged/0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962 deleted file mode 100644 index 33497358..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/10/staged/0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962 +++ /dev/null @@ -1,17 +0,0 @@ -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content -orig content diff --git a/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.MoM b/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.MoM deleted file mode 100644 index 6e84f643..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 6eb0e7f63e37d7d7bb4da5373f470fba55abd13030b8a4251a0bfbe4f84a20c9 100 os-core diff --git a/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.os-core b/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.os-core deleted file mode 100644 index 0e2106ed..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a 100 /testfile diff --git a/test/functional/update/apply-full-file-delta/web-dir/100/delta/10-100-0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962-9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a b/test/functional/update/apply-full-file-delta/web-dir/100/delta/10-100-0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962-9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a deleted file mode 100644 index 6c12b376..00000000 Binary files a/test/functional/update/apply-full-file-delta/web-dir/100/delta/10-100-0832c0c7fb9d05ac3088a493f430e81044a0fc03f81cba9eb89d3b7816ef3962-9f83d713da9df6cabd2abc9d9061f9b611a207e1e0dd22ed7a071ddb1cc1537a and /dev/null differ diff --git a/test/functional/update/apply-full-file-delta/web-dir/version/formatstaging/latest b/test/functional/update/apply-full-file-delta/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/apply-full-file-delta/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/boot-file/lines-checked b/test/functional/update/boot-file/lines-checked deleted file mode 100644 index ccf38195..00000000 --- a/test/functional/update/boot-file/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 0 - new files : 1 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/boot-file/target-dir/usr/lib/kernel/.gitignore b/test/functional/update/boot-file/target-dir/usr/lib/kernel/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/boot-file/target-dir/usr/lib/kernel/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/boot-file/target-dir/usr/lib/os-release b/test/functional/update/boot-file/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/boot-file/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/boot-file/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/boot-file/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/boot-file/test.bats b/test/functional/update/boot-file/test.bats deleted file mode 100755 index b6cb7ee0..00000000 --- a/test/functional/update/boot-file/test.bats +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "update add boot file" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/boot-file/web-dir/10/Manifest.MoM b/test/functional/update/boot-file/web-dir/10/Manifest.MoM deleted file mode 100644 index 3b921c16..00000000 --- a/test/functional/update/boot-file/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 0f026bc0017b676ad1eed7db682408007171cc1c148c39c069f91d740be784d7 10 os-core diff --git a/test/functional/update/boot-file/web-dir/10/Manifest.os-core b/test/functional/update/boot-file/web-dir/10/Manifest.os-core deleted file mode 100644 index 8184dc11..00000000 --- a/test/functional/update/boot-file/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... ede33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib/kernel -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/boot-file/web-dir/100/Manifest.MoM b/test/functional/update/boot-file/web-dir/100/Manifest.MoM deleted file mode 100644 index c98d8eca..00000000 --- a/test/functional/update/boot-file/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... c371f1aa2b5396f4a9f3296acad579ae314d81b0e5bf783e949f88968fa0f39d 100 os-core diff --git a/test/functional/update/boot-file/web-dir/100/Manifest.os-core b/test/functional/update/boot-file/web-dir/100/Manifest.os-core deleted file mode 100644 index 3f1ccc91..00000000 --- a/test/functional/update/boot-file/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,15 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 8 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... ede33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib/kernel -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F.b. e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 100 /usr/lib/kernel/testfile diff --git a/test/functional/update/boot-file/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/update/boot-file/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/update/boot-file/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/update/boot-file/web-dir/version/formatstaging/latest b/test/functional/update/boot-file/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/boot-file/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/boot-skip/lines-checked b/test/functional/update/boot-skip/lines-checked deleted file mode 100644 index 2687aa54..00000000 --- a/test/functional/update/boot-skip/lines-checked +++ /dev/null @@ -1,17 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 0 - new files : 1 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -WARNING: boot files update skipped due to --no-boot-update argument -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/boot-skip/target-dir/usr/lib/kernel/.gitignore b/test/functional/update/boot-skip/target-dir/usr/lib/kernel/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/boot-skip/target-dir/usr/lib/kernel/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/boot-skip/target-dir/usr/lib/os-release b/test/functional/update/boot-skip/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/boot-skip/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/boot-skip/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/boot-skip/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/boot-skip/test.bats b/test/functional/update/boot-skip/test.bats deleted file mode 100755 index 31f25843..00000000 --- a/test/functional/update/boot-skip/test.bats +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "update add boot file with --no-boot-update" { - run sudo sh -c "$SWUPD update -b $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/boot-skip/web-dir/10/Manifest.MoM b/test/functional/update/boot-skip/web-dir/10/Manifest.MoM deleted file mode 100644 index 3b921c16..00000000 --- a/test/functional/update/boot-skip/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 0f026bc0017b676ad1eed7db682408007171cc1c148c39c069f91d740be784d7 10 os-core diff --git a/test/functional/update/boot-skip/web-dir/10/Manifest.os-core b/test/functional/update/boot-skip/web-dir/10/Manifest.os-core deleted file mode 100644 index 8184dc11..00000000 --- a/test/functional/update/boot-skip/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... ede33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib/kernel -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/boot-skip/web-dir/100/Manifest.MoM b/test/functional/update/boot-skip/web-dir/100/Manifest.MoM deleted file mode 100644 index c98d8eca..00000000 --- a/test/functional/update/boot-skip/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... c371f1aa2b5396f4a9f3296acad579ae314d81b0e5bf783e949f88968fa0f39d 100 os-core diff --git a/test/functional/update/boot-skip/web-dir/100/Manifest.os-core b/test/functional/update/boot-skip/web-dir/100/Manifest.os-core deleted file mode 100644 index 3f1ccc91..00000000 --- a/test/functional/update/boot-skip/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,15 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 8 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... ede33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib/kernel -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F.b. e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 100 /usr/lib/kernel/testfile diff --git a/test/functional/update/boot-skip/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/update/boot-skip/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/update/boot-skip/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/update/boot-skip/web-dir/version/formatstaging/latest b/test/functional/update/boot-skip/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/boot-skip/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/delta-without-rename-flag/.gitignore b/test/functional/update/delta-without-rename-flag/.gitignore deleted file mode 100644 index 684c6d7c..00000000 --- a/test/functional/update/delta-without-rename-flag/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target-dir/ diff --git a/test/functional/update/delta-without-rename-flag/lines-checked b/test/functional/update/delta-without-rename-flag/lines-checked deleted file mode 100644 index daf7c961..00000000 --- a/test/functional/update/delta-without-rename-flag/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 20 -Extracting os-core pack for version 20 -Statistics for going from version 10 to version 20: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 2 - deleted files : 2 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 20 diff --git a/test/functional/update/delta-without-rename-flag/test.bats b/test/functional/update/delta-without-rename-flag/test.bats deleted file mode 100755 index a34b02f3..00000000 --- a/test/functional/update/delta-without-rename-flag/test.bats +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_state_dir - clean_target_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - set_os_release 10 - chown_root -R "$DIR/target-dir" "$DIR/web-dir" - unpack_target_from_manifest 10 MoM - unpack_target_from_manifest 10 os-core - sudo tar -C "$DIR/web-dir/20" -cf "$DIR/web-dir/20/pack-os-core-from-10.tar" delta/ staged/ -} - -teardown() { - clean_tars 10 - clean_tars 20 - revert_chown_root -R "$DIR/target-dir" - revert_chown_root -R "$DIR/web-dir" -} - -@test "using delta without a rename flag in the manifest" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - [ -e "$DIR/target-dir/bar" ] - [ ! -e "$DIR/target-dir/foo" ] - [ -e "$DIR/target-dir/bat" ] - [ ! -e "$DIR/target-dir/baz" ] - -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.MoM b/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.MoM deleted file mode 100644 index 06be7494..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1505693993 -contentsize: 5722 - -M... d904b539bd1b18baf1309146e780f952851052203c1fef338b860ec0a47ac614 10 os-core diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.os-core b/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.os-core deleted file mode 100644 index 3ea87a42..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,17 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 9 -timestamp: 1505693993 -contentsize: 5722 -status: ACTIVE - -F... fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 10 /baz -F... 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 10 /foo -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -F... e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f 10 /usr/lib/os-release -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/delta-without-rename-flag/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 190423f8..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 +++ /dev/null @@ -1,100 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 b/test/functional/update/delta-without-rename-flag/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f b/test/functional/update/delta-without-rename-flag/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 b/test/functional/update/delta-without-rename-flag/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 deleted file mode 100644 index 06ed4e5a..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 +++ /dev/null @@ -1,99 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 10 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.MoM b/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.MoM deleted file mode 100644 index 127d2f33..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1505693993 -contentsize: 602 - -M... 5686c249b2a962e3edbaa7d7dea879059f55c6501239dbb402ae15882b5ba379 20 os-core diff --git a/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.os-core b/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.os-core deleted file mode 100644 index 0ba357a1..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,19 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 11 -timestamp: 1505693993 -contentsize: 602 -status: ACTIVE - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core -F... 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 20 /bar -F... c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 20 /bat -.d.. 0000000000000000000000000000000000000000000000000000000000000000 20 /baz -.d.. 0000000000000000000000000000000000000000000000000000000000000000 20 /foo -F... 43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a 20 /usr/lib/os-release diff --git a/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 2f0bb3b9..00000000 Binary files a/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 and /dev/null differ diff --git a/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 b/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 deleted file mode 100644 index f14a2392..00000000 Binary files a/test/functional/update/delta-without-rename-flag/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 and /dev/null differ diff --git a/test/functional/update/delta-without-rename-flag/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a b/test/functional/update/delta-without-rename-flag/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/delta-without-rename-flag/web-dir/version/formatstaging/latest b/test/functional/update/delta-without-rename-flag/web-dir/version/formatstaging/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/update/delta-without-rename-flag/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/update/download/lines-checked b/test/functional/update/download/lines-checked deleted file mode 100644 index 35db2409..00000000 --- a/test/functional/update/download/lines-checked +++ /dev/null @@ -1,12 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Extracting os-core pack for version 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... diff --git a/test/functional/update/download/target-dir/usr/lib/os-release b/test/functional/update/download/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/download/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/download/test.bats b/test/functional/update/download/test.bats deleted file mode 100755 index cb3fb504..00000000 --- a/test/functional/update/download/test.bats +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - # create_pack_tar 10 100 os-core $targetfile - chown_root "$DIR/web-dir/100/staged/$targetfile" - tar -C "$DIR/web-dir/100" -cf "$DIR/web-dir/100/pack-os-core-from-10.tar" --exclude=staged/$targetfile/* staged/$targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - revert_chown_root "$DIR/web-dir/100/staged/$targetfile" -} - -@test "update only download packs" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --download" - - [ "$status" -eq 0 ] - check_lines "$output" - [ ! -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/download/web-dir/10/Manifest.MoM b/test/functional/update/download/web-dir/10/Manifest.MoM deleted file mode 100644 index 7f115843..00000000 --- a/test/functional/update/download/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core diff --git a/test/functional/update/download/web-dir/10/Manifest.os-core b/test/functional/update/download/web-dir/10/Manifest.os-core deleted file mode 100644 index ce24deed..00000000 --- a/test/functional/update/download/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin diff --git a/test/functional/update/download/web-dir/100/Manifest.MoM b/test/functional/update/download/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/update/download/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/update/download/web-dir/100/Manifest.os-core b/test/functional/update/download/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/download/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/download/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/download/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/download/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/download/web-dir/version/formatstaging/latest b/test/functional/update/download/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/download/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/lines-checked b/test/functional/update/include-old-bundle-with-tracked-file/lines-checked deleted file mode 100644 index e3fff8b2..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 20 to 30 -Statistics for going from version 20 to version 30: - changed bundles : 3 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 1 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -2 files were not in a pack -Update successful. System updated from version 20 to version 30 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/lib/os-release b/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/lib/os-release deleted file mode 100644 index e3816099..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=20 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/test-bundle2 b/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/test-bundle2 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/test-bundle3 b/test/functional/update/include-old-bundle-with-tracked-file/target-dir/usr/share/clear/bundles/test-bundle3 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/test.bats b/test/functional/update/include-old-bundle-with-tracked-file/test.bats deleted file mode 100755 index af31f7b4..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/test.bats +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 -f2=826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 10 test-bundle2 - create_manifest_tar 10 test-bundle3 - - create_fullfile_tar 10 $f1 - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - - create_manifest_tar 30 MoM - sign_manifest_mom 30 - create_manifest_tar 30 os-core - create_manifest_tar 30 test-bundle2 - create_manifest_tar 30 test-bundle3 - - create_fullfile_tar 30 $f1 - create_fullfile_tar 30 $f2 -} - -teardown() { - clean_tars 10 - clean_tars 20 - clean_tars 30 - clean_tars 10 files - clean_tars 30 files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/30/files/$f1" - revert_chown_root "$DIR/web-dir/30/files/$f2" - sudo rm "$DIR/target-dir/os-core" - sudo rm "$DIR/target-dir/tracked-file" -} - -@test "update include a bundle from an older release" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - # changed file - [ -f "$DIR/target-dir/os-core" ] - - # new file - [ -f "$DIR/target-dir/tracked-file" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.MoM b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.MoM deleted file mode 100644 index 31848325..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 580f053aa17496cf73a8d579efd4f9fe3af5648b955c2543ec29b88ea467b8ef 10 os-core -M... 3a93b49b962874fc6c667f1844aef3fb5508fde5df3bdf71fef71de21acc1d37 10 test-bundle1 -M... 9a3001655397ab5a5cd40debb72f2c36f1aea02c50aa4429a9efbeee8ac2f359 10 test-bundle2 -M... fd2b1650fd767509cbe3d8ac6019e96b3c85cb836fba29befe0f9243cb683ac3 10 test-bundle3 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.os-core b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.os-core deleted file mode 100644 index 99ba6914..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... dead4952523cf67d92b9f4f03057ca1bf6e1ff018104f7f7ad27d5d4fb38b9ad 10 /os-core diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle1 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index 7850d926..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 10 /tracked-file diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle2 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle2 deleted file mode 100644 index 55428a24..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... dead85caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 10 /test-bundle2 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle3 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle3 deleted file mode 100644 index c31431b8..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/Manifest.test-bundle3 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... dead0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 10 /test-bundle3 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 deleted file mode 100644 index c2f10812..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/10/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 +++ /dev/null @@ -1 +0,0 @@ -tracked-file diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.MoM b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.MoM deleted file mode 100644 index 569530a2..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 6b7c14932616dc7ab12bcc08458b6881c2f462b6724dbab5864415933d92d762 20 os-core -M... 3a93b49b962874fc6c667f1844aef3fb5508fde5df3bdf71fef71de21acc1d37 10 test-bundle1 -M... 9a3001655397ab5a5cd40debb72f2c36f1aea02c50aa4429a9efbeee8ac2f359 10 test-bundle2 -M... fd2b1650fd767509cbe3d8ac6019e96b3c85cb836fba29befe0f9243cb683ac3 10 test-bundle3 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.os-core b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.os-core deleted file mode 100644 index 3ef9d782..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... dead0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 20 /os-core diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.MoM b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.MoM deleted file mode 100644 index 090c9046..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.MoM +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3a93b49b962874fc6c667f1844aef3fb5508fde5df3bdf71fef71de21acc1d37 10 test-bundle1 -M... 692b27fa22c01d0d513020a7b2e381e9bf8f8fabaf29bf6dd0023fe178c9ee11 30 test-bundle2 -M... 0f66afd9535a1ac74f35b080cbecd5836528b26024d2d73c18bb3b27a42206dd 30 test-bundle3 -M... 426e8b2ed2054421880ca41c5ac05aaf29337a1a42eea93ba11cd09b621f3e66 30 os-core diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.os-core b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.os-core deleted file mode 100644 index 6b725dbf..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 30 /os-core diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle2 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle2 deleted file mode 100644 index 3bc25e2a..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle2 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle1 - -F... dead85caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 10 /test-bundle2 diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle3 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle3 deleted file mode 100644 index 45aa362b..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/Manifest.test-bundle3 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... dead0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 10 /test-bundle3 -F... e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 30 /tracked-file diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 deleted file mode 100644 index 34e0b5e6..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 +++ /dev/null @@ -1 +0,0 @@ -os-core diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 deleted file mode 100644 index c2f10812..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/30/files/e324302d81e79a935137bd4ed6ab6c6792aa6d4356c9c227342eaa0db015c152 +++ /dev/null @@ -1 +0,0 @@ -tracked-file diff --git a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/version/formatstaging/latest b/test/functional/update/include-old-bundle-with-tracked-file/web-dir/version/formatstaging/latest deleted file mode 100644 index 64bb6b74..00000000 --- a/test/functional/update/include-old-bundle-with-tracked-file/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -30 diff --git a/test/functional/update/include-old-bundle/lines-checked b/test/functional/update/include-old-bundle/lines-checked deleted file mode 100644 index a40550eb..00000000 --- a/test/functional/update/include-old-bundle/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 2 - new bundles : 0 - deleted bundles : 0 - changed files : 2 - new files : 1 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -3 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/include-old-bundle/target-dir/usr/lib/os-release b/test/functional/update/include-old-bundle/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/include-old-bundle/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/include-old-bundle/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/include-old-bundle/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include-old-bundle/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/update/include-old-bundle/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include-old-bundle/test.bats b/test/functional/update/include-old-bundle/test.bats deleted file mode 100755 index 11368c36..00000000 --- a/test/functional/update/include-old-bundle/test.bats +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 -f2=a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 -f3=826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 10 test-bundle2 - - create_fullfile_tar 10 $f1 - - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_manifest_tar 100 test-bundle1 - - create_fullfile_tar 100 $f2 - create_fullfile_tar 100 $f3 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 10 files - clean_tars 100 files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/100/files/$f2" - revert_chown_root "$DIR/web-dir/100/files/$f3" - sudo rm "$DIR/target-dir/os-core" - sudo rm "$DIR/target-dir/test-bundle1" - sudo rm "$DIR/target-dir/test-bundle2" -} - -@test "update include a bundle from an older release" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - # changed files - [ -f "$DIR/target-dir/os-core" ] - [ -f "$DIR/target-dir/test-bundle1" ] - - # new file - [ -f "$DIR/target-dir/test-bundle2" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/include-old-bundle/web-dir/10/Manifest.MoM b/test/functional/update/include-old-bundle/web-dir/10/Manifest.MoM deleted file mode 100644 index 89d019b5..00000000 --- a/test/functional/update/include-old-bundle/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 580f053aa17496cf73a8d579efd4f9fe3af5648b955c2543ec29b88ea467b8ef 10 os-core -M... 98280dd551d2240379a523538b7eb774c72e9685085f77f2ed51b1d966ef172c 10 test-bundle1 -M... 7850d639166a2a7e166b1150448b80f39296c811c9a899e2823433e094322deb 10 test-bundle2 diff --git a/test/functional/update/include-old-bundle/web-dir/10/Manifest.os-core b/test/functional/update/include-old-bundle/web-dir/10/Manifest.os-core deleted file mode 100644 index 99ba6914..00000000 --- a/test/functional/update/include-old-bundle/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... dead4952523cf67d92b9f4f03057ca1bf6e1ff018104f7f7ad27d5d4fb38b9ad 10 /os-core diff --git a/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle1 b/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index 614d8d8d..00000000 --- a/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... dead955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-bundle1 diff --git a/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle2 b/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle2 deleted file mode 100644 index 280b8ad6..00000000 --- a/test/functional/update/include-old-bundle/web-dir/10/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... 491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 10 /test-bundle2 diff --git a/test/functional/update/include-old-bundle/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 b/test/functional/update/include-old-bundle/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 deleted file mode 100644 index be15e407..00000000 --- a/test/functional/update/include-old-bundle/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 +++ /dev/null @@ -1 +0,0 @@ -test-bundle2 diff --git a/test/functional/update/include-old-bundle/web-dir/100/Manifest.MoM b/test/functional/update/include-old-bundle/web-dir/100/Manifest.MoM deleted file mode 100644 index a60984b7..00000000 --- a/test/functional/update/include-old-bundle/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 88d187e20077ac674ee02a0f2bdc5da780ee2eceb23a341ddeb50e35f9d423f6 100 os-core -M... fd21b17f85529035177e0b97bb97b0466cf3f9f741459ecd46249ad4f2f0dc12 100 test-bundle1 -M... 7850d639166a2a7e166b1150448b80f39296c811c9a899e2823433e094322deb 10 test-bundle2 diff --git a/test/functional/update/include-old-bundle/web-dir/100/Manifest.os-core b/test/functional/update/include-old-bundle/web-dir/100/Manifest.os-core deleted file mode 100644 index 3fc933f0..00000000 --- a/test/functional/update/include-old-bundle/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 100 /os-core diff --git a/test/functional/update/include-old-bundle/web-dir/100/Manifest.test-bundle1 b/test/functional/update/include-old-bundle/web-dir/100/Manifest.test-bundle1 deleted file mode 100644 index 64f8c2e3..00000000 --- a/test/functional/update/include-old-bundle/web-dir/100/Manifest.test-bundle1 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle2 - -F... a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 100 /test-bundle1 diff --git a/test/functional/update/include-old-bundle/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 b/test/functional/update/include-old-bundle/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 deleted file mode 100644 index 34e0b5e6..00000000 --- a/test/functional/update/include-old-bundle/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 +++ /dev/null @@ -1 +0,0 @@ -os-core diff --git a/test/functional/update/include-old-bundle/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 b/test/functional/update/include-old-bundle/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 deleted file mode 100644 index 639db438..00000000 --- a/test/functional/update/include-old-bundle/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 +++ /dev/null @@ -1 +0,0 @@ -test-bundle1 diff --git a/test/functional/update/include-old-bundle/web-dir/version/formatstaging/latest b/test/functional/update/include-old-bundle/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/include-old-bundle/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/include/lines-checked b/test/functional/update/include/lines-checked deleted file mode 100644 index 19b5c664..00000000 --- a/test/functional/update/include/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 2 - new bundles : 6 - deleted bundles : 0 - changed files : 2 - new files : 6 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -8 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/include/target-dir/usr/lib/os-release b/test/functional/update/include/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/include/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/include/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/include/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/update/include/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/include/test.bats b/test/functional/update/include/test.bats deleted file mode 100755 index 4561b434..00000000 --- a/test/functional/update/include/test.bats +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e -f2=5f79d142c1859a3d82e9391a9a23a5f697e9346714412b67c78729c5a7b6ae1f -f3=a325dc221e0e03802b5a81abdf7318074230ca1f980985032048b5b6ce193850 -f4=d1f70150c56e960ca18bd636131fae747487ac93836429ada2a46f85b88af28f -f5=4185aaf172a7f8b0cffb79fa379dc2227edb7097f24a61f7ce5b3881e38a66a2 -f6=e2c7d7bb180e8b44ce0fb4e58f3b2f3852d7fbbb0fafbe04e41159d006501a88 -f7=01fe90f246616cc07c216fa4fc1444881a5f2804650989996a44d223e0bfb105 -f8=9a94d945b3841b70df7117fd02cffa36e4f1e5b430703b8fd26c086bf1059e72 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 10 test-bundle2 - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_manifest_tar 100 test-bundle1 - create_manifest_tar 100 test-bundle2 - create_manifest_tar 100 test-bundle3 - create_manifest_tar 100 test-bundle4 - create_manifest_tar 100 test-bundle5 - create_manifest_tar 100 test-bundle6 - create_manifest_tar 100 test-bundle7 - create_fullfile_tar 100 $f1 - create_fullfile_tar 100 $f2 - create_fullfile_tar 100 $f3 - create_fullfile_tar 100 $f4 - create_fullfile_tar 100 $f5 - create_fullfile_tar 100 $f6 - create_fullfile_tar 100 $f7 - create_fullfile_tar 100 $f8 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$f1" - revert_chown_root "$DIR/web-dir/100/files/$f2" - revert_chown_root "$DIR/web-dir/100/files/$f3" - revert_chown_root "$DIR/web-dir/100/files/$f4" - revert_chown_root "$DIR/web-dir/100/files/$f5" - revert_chown_root "$DIR/web-dir/100/files/$f6" - revert_chown_root "$DIR/web-dir/100/files/$f7" - revert_chown_root "$DIR/web-dir/100/files/$f8" - sudo rmdir "$DIR/target-dir/usr/bin" - sudo rm "$DIR/target-dir/usr/core" - sudo rm "$DIR/target-dir/usr/foo2" - sudo rm "$DIR/target-dir/usr/foo3" - sudo rm "$DIR/target-dir/usr/foo4" - sudo rm "$DIR/target-dir/usr/foo5" - sudo rm "$DIR/target-dir/usr/foo6" - sudo rm "$DIR/target-dir/usr/foo7" -} - -@test "update with includes" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - # changed files - [ -d "$DIR/target-dir/usr/bin" ] - [ -f "$DIR/target-dir/usr/core" ] - - # new files - [ -f "$DIR/target-dir/usr/foo2" ] - [ -f "$DIR/target-dir/usr/foo3" ] - [ -f "$DIR/target-dir/usr/foo4" ] - [ -f "$DIR/target-dir/usr/foo5" ] - [ -f "$DIR/target-dir/usr/foo6" ] - [ -f "$DIR/target-dir/usr/foo7" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/include/web-dir/10/Manifest.MoM b/test/functional/update/include/web-dir/10/Manifest.MoM deleted file mode 100644 index a3390a7f..00000000 --- a/test/functional/update/include/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 607b36d693fe9d3366ae2c994402387f1bb75ce287565d4534fa288a40bc6872 10 os-core -M... 80c89d8fca3bb6ac550a51c9ef660f51877912098bb4dbe2da35de76dbbbd8fe 10 test-bundle1 -M... 7a7ee4ee962e8246287f65073cdc3273661d13e455d1138ce78410f204c2e091 10 test-bundle2 diff --git a/test/functional/update/include/web-dir/10/Manifest.os-core b/test/functional/update/include/web-dir/10/Manifest.os-core deleted file mode 100644 index 9fd8b013..00000000 --- a/test/functional/update/include/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... a5a84952523cf67d92b9f4f03057ca1bf6e1ff018104f7f7ad27d5d4fb38b9ad 10 /usr/core diff --git a/test/functional/update/include/web-dir/10/Manifest.test-bundle1 b/test/functional/update/include/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index 0c226e40..00000000 --- a/test/functional/update/include/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -D... 34d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin diff --git a/test/functional/update/include/web-dir/10/Manifest.test-bundle2 b/test/functional/update/include/web-dir/10/Manifest.test-bundle2 deleted file mode 100644 index 11489d89..00000000 --- a/test/functional/update/include/web-dir/10/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... e56e570097c2932ff0454cb45ef37964c6a0792e0224013f9e1d837cc22aa9fa 10 /usr/foo2 diff --git a/test/functional/update/include/web-dir/100/Manifest.MoM b/test/functional/update/include/web-dir/100/Manifest.MoM deleted file mode 100644 index ba6af964..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,15 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 1679174550ca793949334dc8d6ed6d736af61442f0c9137148e8330d0aa670a2 100 os-core -M... dfa44c9f3f9f57589f143cf6c62ee9d53144312ce596a04334afce6efe011116 100 test-bundle1 -M... 7336fe557ec7fc77559c66b533877d23710ff11c3515bd6a998fc7b6808f78d9 100 test-bundle2 -M... 06c69b0a7ba4d6a78636e1e635e901ea63371f57cf343fa973b8601f275f3c97 100 test-bundle3 -M... 9175ebec7b043ca1df5af8584469c7431dbdb22c6ec686040e31eed4004b7cd9 100 test-bundle4 -M... 84eb04928ebd2a2f3d8c344de25c1fbd90ccecebab30bbdd7cdd99ded10d03af 100 test-bundle5 -M... 78f6e6a01cf32d35c72f5b10bc195aa5c2853a120d581a8cfa53516967461cd5 100 test-bundle6 -M... 52db7c0d2148e283ee396163566e18a39ac2a7defe6eab3c107eb6a7591f1e3e 100 test-bundle7 diff --git a/test/functional/update/include/web-dir/100/Manifest.os-core b/test/functional/update/include/web-dir/100/Manifest.os-core deleted file mode 100644 index 3ac3cdc3..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... a325dc221e0e03802b5a81abdf7318074230ca1f980985032048b5b6ce193850 100 /usr/core diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle1 b/test/functional/update/include/web-dir/100/Manifest.test-bundle1 deleted file mode 100644 index 1715a090..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle1 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle3 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle2 b/test/functional/update/include/web-dir/100/Manifest.test-bundle2 deleted file mode 100644 index f6130006..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle2 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle7 - -F... 5f79d142c1859a3d82e9391a9a23a5f697e9346714412b67c78729c5a7b6ae1f 100 /usr/foo2 diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle3 b/test/functional/update/include/web-dir/100/Manifest.test-bundle3 deleted file mode 100644 index fcfa1b82..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle3 +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle2 -includes: test-bundle4 - -F... d1f70150c56e960ca18bd636131fae747487ac93836429ada2a46f85b88af28f 100 /usr/foo3 diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle4 b/test/functional/update/include/web-dir/100/Manifest.test-bundle4 deleted file mode 100644 index d5b7d3c1..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle4 +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle5 -includes: test-bundle6 - -F... 4185aaf172a7f8b0cffb79fa379dc2227edb7097f24a61f7ce5b3881e38a66a2 100 /usr/foo4 diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle5 b/test/functional/update/include/web-dir/100/Manifest.test-bundle5 deleted file mode 100644 index e6430e34..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle5 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle2 - -F... e2c7d7bb180e8b44ce0fb4e58f3b2f3852d7fbbb0fafbe04e41159d006501a88 100 /usr/foo5 diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle6 b/test/functional/update/include/web-dir/100/Manifest.test-bundle6 deleted file mode 100644 index 9cd8da0f..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle6 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... 01fe90f246616cc07c216fa4fc1444881a5f2804650989996a44d223e0bfb105 100 /usr/foo6 diff --git a/test/functional/update/include/web-dir/100/Manifest.test-bundle7 b/test/functional/update/include/web-dir/100/Manifest.test-bundle7 deleted file mode 100644 index c4988652..00000000 --- a/test/functional/update/include/web-dir/100/Manifest.test-bundle7 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... 9a94d945b3841b70df7117fd02cffa36e4f1e5b430703b8fd26c086bf1059e72 100 /usr/foo7 diff --git a/test/functional/update/include/web-dir/100/files/01fe90f246616cc07c216fa4fc1444881a5f2804650989996a44d223e0bfb105 b/test/functional/update/include/web-dir/100/files/01fe90f246616cc07c216fa4fc1444881a5f2804650989996a44d223e0bfb105 deleted file mode 100644 index 3ed766d1..00000000 --- a/test/functional/update/include/web-dir/100/files/01fe90f246616cc07c216fa4fc1444881a5f2804650989996a44d223e0bfb105 +++ /dev/null @@ -1 +0,0 @@ -test-bundle6 file diff --git a/test/functional/update/include/web-dir/100/files/4185aaf172a7f8b0cffb79fa379dc2227edb7097f24a61f7ce5b3881e38a66a2 b/test/functional/update/include/web-dir/100/files/4185aaf172a7f8b0cffb79fa379dc2227edb7097f24a61f7ce5b3881e38a66a2 deleted file mode 100644 index 8a26551b..00000000 --- a/test/functional/update/include/web-dir/100/files/4185aaf172a7f8b0cffb79fa379dc2227edb7097f24a61f7ce5b3881e38a66a2 +++ /dev/null @@ -1 +0,0 @@ -test-bundle4 file diff --git a/test/functional/update/include/web-dir/100/files/5f79d142c1859a3d82e9391a9a23a5f697e9346714412b67c78729c5a7b6ae1f b/test/functional/update/include/web-dir/100/files/5f79d142c1859a3d82e9391a9a23a5f697e9346714412b67c78729c5a7b6ae1f deleted file mode 100644 index 0944d0dc..00000000 --- a/test/functional/update/include/web-dir/100/files/5f79d142c1859a3d82e9391a9a23a5f697e9346714412b67c78729c5a7b6ae1f +++ /dev/null @@ -1 +0,0 @@ -test-bundle2 file diff --git a/test/functional/update/include/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/include/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/include/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/include/web-dir/100/files/9a94d945b3841b70df7117fd02cffa36e4f1e5b430703b8fd26c086bf1059e72 b/test/functional/update/include/web-dir/100/files/9a94d945b3841b70df7117fd02cffa36e4f1e5b430703b8fd26c086bf1059e72 deleted file mode 100644 index b7ccdacb..00000000 --- a/test/functional/update/include/web-dir/100/files/9a94d945b3841b70df7117fd02cffa36e4f1e5b430703b8fd26c086bf1059e72 +++ /dev/null @@ -1 +0,0 @@ -test-bundle7 file diff --git a/test/functional/update/include/web-dir/100/files/a325dc221e0e03802b5a81abdf7318074230ca1f980985032048b5b6ce193850 b/test/functional/update/include/web-dir/100/files/a325dc221e0e03802b5a81abdf7318074230ca1f980985032048b5b6ce193850 deleted file mode 100644 index 1e1cf840..00000000 --- a/test/functional/update/include/web-dir/100/files/a325dc221e0e03802b5a81abdf7318074230ca1f980985032048b5b6ce193850 +++ /dev/null @@ -1 +0,0 @@ -os-core file diff --git a/test/functional/update/include/web-dir/100/files/d1f70150c56e960ca18bd636131fae747487ac93836429ada2a46f85b88af28f b/test/functional/update/include/web-dir/100/files/d1f70150c56e960ca18bd636131fae747487ac93836429ada2a46f85b88af28f deleted file mode 100644 index b822c353..00000000 --- a/test/functional/update/include/web-dir/100/files/d1f70150c56e960ca18bd636131fae747487ac93836429ada2a46f85b88af28f +++ /dev/null @@ -1 +0,0 @@ -test-bundle3 file diff --git a/test/functional/update/include/web-dir/100/files/e2c7d7bb180e8b44ce0fb4e58f3b2f3852d7fbbb0fafbe04e41159d006501a88 b/test/functional/update/include/web-dir/100/files/e2c7d7bb180e8b44ce0fb4e58f3b2f3852d7fbbb0fafbe04e41159d006501a88 deleted file mode 100644 index 43c495ca..00000000 --- a/test/functional/update/include/web-dir/100/files/e2c7d7bb180e8b44ce0fb4e58f3b2f3852d7fbbb0fafbe04e41159d006501a88 +++ /dev/null @@ -1 +0,0 @@ -test-bundle5 file diff --git a/test/functional/update/include/web-dir/version/formatstaging/latest b/test/functional/update/include/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/include/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/missing-os-core/lines-checked b/test/functional/update/missing-os-core/lines-checked deleted file mode 100644 index aa4709c2..00000000 --- a/test/functional/update/missing-os-core/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 2 - new bundles : 0 - deleted bundles : 0 - changed files : 2 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/missing-os-core/target-dir/usr/lib/os-release b/test/functional/update/missing-os-core/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/missing-os-core/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/missing-os-core/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/update/missing-os-core/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/missing-os-core/test.bats b/test/functional/update/missing-os-core/test.bats deleted file mode 100755 index a3718f91..00000000 --- a/test/functional/update/missing-os-core/test.bats +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_manifest_tar 100 test-bundle1 - - create_fullfile_tar 100 $f1 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$f1" - sudo rmdir "$DIR/target-dir/os-core" - sudo rmdir "$DIR/target-dir/usr/bin" -} - -@test "update always add os-core to tracked bundles" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - # changed files (hashes didn't change, only the versions) - [ -d "$DIR/target-dir/os-core" ] - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/missing-os-core/web-dir/10/Manifest.MoM b/test/functional/update/missing-os-core/web-dir/10/Manifest.MoM deleted file mode 100644 index 9f4021b9..00000000 --- a/test/functional/update/missing-os-core/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... e9462e2b7e5b852bc19bda5f241ffaa4fecceec0ef89a3f0d3d4a66e31bb1a5e 10 os-core -M... 1bf200ad0db7009656842c8b1751be4b6b4e3956d7a53065d45e289356792cb1 10 test-bundle1 diff --git a/test/functional/update/missing-os-core/web-dir/10/Manifest.os-core b/test/functional/update/missing-os-core/web-dir/10/Manifest.os-core deleted file mode 100644 index dd080d54..00000000 --- a/test/functional/update/missing-os-core/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /os-core diff --git a/test/functional/update/missing-os-core/web-dir/10/Manifest.test-bundle1 b/test/functional/update/missing-os-core/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index 7179a140..00000000 --- a/test/functional/update/missing-os-core/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/update/missing-os-core/web-dir/100/Manifest.MoM b/test/functional/update/missing-os-core/web-dir/100/Manifest.MoM deleted file mode 100644 index 5360fe6d..00000000 --- a/test/functional/update/missing-os-core/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... a7fdf10d1bbac1a82f1b0fea299e6df6841093ff47c084a95f3809b40b5b846a 100 os-core -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 test-bundle1 diff --git a/test/functional/update/missing-os-core/web-dir/100/Manifest.os-core b/test/functional/update/missing-os-core/web-dir/100/Manifest.os-core deleted file mode 100644 index f5f8cbed..00000000 --- a/test/functional/update/missing-os-core/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /os-core diff --git a/test/functional/update/missing-os-core/web-dir/100/Manifest.test-bundle1 b/test/functional/update/missing-os-core/web-dir/100/Manifest.test-bundle1 deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/missing-os-core/web-dir/100/Manifest.test-bundle1 +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/missing-os-core/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/missing-os-core/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/missing-os-core/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/missing-os-core/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/update/missing-os-core/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/update/missing-os-core/web-dir/100/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/update/missing-os-core/web-dir/version/formatstaging/latest b/test/functional/update/missing-os-core/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/missing-os-core/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/newest-deleted/lines-checked b/test/functional/update/newest-deleted/lines-checked deleted file mode 100644 index 4388a582..00000000 --- a/test/functional/update/newest-deleted/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 20 to 30 -Extracting os-core pack for version 30 -Statistics for going from version 20 to version 30: - changed bundles : 2 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 1 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 20 to version 30 diff --git a/test/functional/update/newest-deleted/target-dir/testfile b/test/functional/update/newest-deleted/target-dir/testfile deleted file mode 100644 index b0e77ea5..00000000 --- a/test/functional/update/newest-deleted/target-dir/testfile +++ /dev/null @@ -1 +0,0 @@ -should be deleted diff --git a/test/functional/update/newest-deleted/target-dir/usr/lib/os-release b/test/functional/update/newest-deleted/target-dir/usr/lib/os-release deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/newest-deleted/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/test-bundle2 b/test/functional/update/newest-deleted/target-dir/usr/share/clear/bundles/test-bundle2 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/newest-deleted/test.bats b/test/functional/update/newest-deleted/test.bats deleted file mode 100755 index 31ceab4c..00000000 --- a/test/functional/update/newest-deleted/test.bats +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -os_release_file=1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_manifest_tar 20 test-bundle2 - create_manifest_tar 30 MoM - sign_manifest_mom 30 - create_manifest_tar 30 os-core - create_manifest_tar 30 test-bundle2 - chown_root "$DIR/web-dir/30/staged/$os_release_file" - tar -C "$DIR/web-dir/30" -cf "$DIR/web-dir/30/pack-os-core-from-20.tar" staged/$os_release_file - cp "$DIR/target-dir/testfile" "$DIR" -} - -teardown() { - clean_tars 10 - clean_tars 20 - clean_tars 30 - revert_chown_root "$DIR/web-dir/30/staged/$os_release_file" - sed -i 's/30/20/' "$DIR/target-dir/usr/lib/os-release" - mv "$DIR/testfile" "$DIR/target-dir/" -} - -@test "update where the newest version of a file was deleted" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ ! -f "$DIR/target-dir/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/newest-deleted/web-dir/10/Manifest.MoM b/test/functional/update/newest-deleted/web-dir/10/Manifest.MoM deleted file mode 100644 index d370adc5..00000000 --- a/test/functional/update/newest-deleted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 5dc1f6c06b41f455580ac76e319656c050fa255b075ba3383201e6265fe5a984 10 os-core -M... de1d085c0fe6adc1e7b769d9d8e30be7437972366e47424cdf155ae8623cf773 10 test-bundle1 diff --git a/test/functional/update/newest-deleted/web-dir/10/Manifest.os-core b/test/functional/update/newest-deleted/web-dir/10/Manifest.os-core deleted file mode 100644 index 1cecae2b..00000000 --- a/test/functional/update/newest-deleted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -F... ede33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib/os-release -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/newest-deleted/web-dir/10/Manifest.test-bundle1 b/test/functional/update/newest-deleted/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index c27982ec..00000000 --- a/test/functional/update/newest-deleted/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -.d.. 0000000000000000000000000000000000000000000000000000000000000000 10 /testfile -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/test-bundle1 diff --git a/test/functional/update/newest-deleted/web-dir/20/Manifest.MoM b/test/functional/update/newest-deleted/web-dir/20/Manifest.MoM deleted file mode 100644 index c5eefdc7..00000000 --- a/test/functional/update/newest-deleted/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 3 -timestamp: 1451940175 -contentsize: 0 - -M... de1d085c0fe6adc1e7b769d9d8e30be7437972366e47424cdf155ae8623cf773 10 test-bundle1 -M... f7abb1fdb99a70673498212f0bfd7f110757806e7a849563b4c7f886ea6352a0 20 os-core -M... 374556e970f164bd3e72dfdbd55bbabe332fef4e8b88667a67108cba5fcf4093 20 test-bundle2 diff --git a/test/functional/update/newest-deleted/web-dir/20/Manifest.os-core b/test/functional/update/newest-deleted/web-dir/20/Manifest.os-core deleted file mode 100644 index 9ce89181..00000000 --- a/test/functional/update/newest-deleted/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F... fde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 20 /usr/lib/os-release diff --git a/test/functional/update/newest-deleted/web-dir/20/Manifest.test-bundle2 b/test/functional/update/newest-deleted/web-dir/20/Manifest.test-bundle2 deleted file mode 100644 index 6e5b33e6..00000000 --- a/test/functional/update/newest-deleted/web-dir/20/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... a85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /testfile -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /usr/share/clear/bundles/test-bundle2 diff --git a/test/functional/update/newest-deleted/web-dir/30/Manifest.MoM b/test/functional/update/newest-deleted/web-dir/30/Manifest.MoM deleted file mode 100644 index 3b17d671..00000000 --- a/test/functional/update/newest-deleted/web-dir/30/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 3 -timestamp: 1451940175 -contentsize: 0 - -M... de1d085c0fe6adc1e7b769d9d8e30be7437972366e47424cdf155ae8623cf773 10 test-bundle1 -M... 1af6a129461858652689ec4aecfef82387bb3fcd340a42e2522ad94106f48cc1 30 os-core -M... b8ded2baace8abf056602b1c8cc44b89af6b906f1708cbda8c8f20ddf5eab8f3 30 test-bundle2 diff --git a/test/functional/update/newest-deleted/web-dir/30/Manifest.os-core b/test/functional/update/newest-deleted/web-dir/30/Manifest.os-core deleted file mode 100644 index e07d98cc..00000000 --- a/test/functional/update/newest-deleted/web-dir/30/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F... 1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 30 /usr/lib/os-release diff --git a/test/functional/update/newest-deleted/web-dir/30/Manifest.test-bundle2 b/test/functional/update/newest-deleted/web-dir/30/Manifest.test-bundle2 deleted file mode 100644 index d77e859b..00000000 --- a/test/functional/update/newest-deleted/web-dir/30/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /usr/share/clear/bundles/test-bundle2 -.d.. 0000000000000000000000000000000000000000000000000000000000000000 30 /testfile diff --git a/test/functional/update/newest-deleted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 b/test/functional/update/newest-deleted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 deleted file mode 100644 index 9e48031d..00000000 --- a/test/functional/update/newest-deleted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=30 diff --git a/test/functional/update/newest-deleted/web-dir/version/formatstaging/latest b/test/functional/update/newest-deleted/web-dir/version/formatstaging/latest deleted file mode 100644 index 64bb6b74..00000000 --- a/test/functional/update/newest-deleted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -30 diff --git a/test/functional/update/newest-ghosted/lines-checked b/test/functional/update/newest-ghosted/lines-checked deleted file mode 100644 index 4388a582..00000000 --- a/test/functional/update/newest-ghosted/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 20 to 30 -Extracting os-core pack for version 30 -Statistics for going from version 20 to version 30: - changed bundles : 2 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 1 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 20 to version 30 diff --git a/test/functional/update/newest-ghosted/target-dir/testfile b/test/functional/update/newest-ghosted/target-dir/testfile deleted file mode 100644 index b0e77ea5..00000000 --- a/test/functional/update/newest-ghosted/target-dir/testfile +++ /dev/null @@ -1 +0,0 @@ -should be deleted diff --git a/test/functional/update/newest-ghosted/target-dir/usr/lib/os-release b/test/functional/update/newest-ghosted/target-dir/usr/lib/os-release deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/newest-ghosted/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/newest-ghosted/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/newest-ghosted/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/newest-ghosted/target-dir/usr/share/clear/bundles/test-bundle2 b/test/functional/update/newest-ghosted/target-dir/usr/share/clear/bundles/test-bundle2 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/newest-ghosted/test.bats b/test/functional/update/newest-ghosted/test.bats deleted file mode 100755 index 4d331f78..00000000 --- a/test/functional/update/newest-ghosted/test.bats +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -os_release_file=1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 - -setup() { - clean_test_dir - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_manifest_tar 20 test-bundle2 - create_manifest_tar 30 MoM - sign_manifest_mom 30 - create_manifest_tar 30 os-core - create_manifest_tar 30 test-bundle2 - chown_root "$DIR/web-dir/30/staged/$os_release_file" - tar -C "$DIR/web-dir/30" -cf "$DIR/web-dir/30/pack-os-core-from-20.tar" staged/$os_release_file - cp "$DIR/target-dir/testfile" "$DIR" -} - -teardown() { - clean_tars 20 - clean_tars 30 - revert_chown_root "$DIR/web-dir/30/staged/$os_release_file" - sed -i 's/30/20/' "$DIR/target-dir/usr/lib/os-release" - mv "$DIR/testfile" "$DIR/target-dir/" -} - -@test "update where the newest version of a file was ghosted" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -f "$DIR/target-dir/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/newest-ghosted/web-dir/20/Manifest.MoM b/test/functional/update/newest-ghosted/web-dir/20/Manifest.MoM deleted file mode 100644 index be631633..00000000 --- a/test/functional/update/newest-ghosted/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... f7abb1fdb99a70673498212f0bfd7f110757806e7a849563b4c7f886ea6352a0 20 os-core -M... 374556e970f164bd3e72dfdbd55bbabe332fef4e8b88667a67108cba5fcf4093 20 test-bundle2 diff --git a/test/functional/update/newest-ghosted/web-dir/20/Manifest.os-core b/test/functional/update/newest-ghosted/web-dir/20/Manifest.os-core deleted file mode 100644 index 9ce89181..00000000 --- a/test/functional/update/newest-ghosted/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F... fde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 20 /usr/lib/os-release diff --git a/test/functional/update/newest-ghosted/web-dir/20/Manifest.test-bundle2 b/test/functional/update/newest-ghosted/web-dir/20/Manifest.test-bundle2 deleted file mode 100644 index 6e5b33e6..00000000 --- a/test/functional/update/newest-ghosted/web-dir/20/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... a85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /testfile -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /usr/share/clear/bundles/test-bundle2 diff --git a/test/functional/update/newest-ghosted/web-dir/30/Manifest.MoM b/test/functional/update/newest-ghosted/web-dir/30/Manifest.MoM deleted file mode 100644 index eba65e7f..00000000 --- a/test/functional/update/newest-ghosted/web-dir/30/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 1af6a129461858652689ec4aecfef82387bb3fcd340a42e2522ad94106f48cc1 30 os-core -M... 21b4370ae849732b644503ad64048388392dec1f0c4e7bf7287e70657dfab9f0 30 test-bundle2 diff --git a/test/functional/update/newest-ghosted/web-dir/30/Manifest.os-core b/test/functional/update/newest-ghosted/web-dir/30/Manifest.os-core deleted file mode 100644 index e07d98cc..00000000 --- a/test/functional/update/newest-ghosted/web-dir/30/Manifest.os-core +++ /dev/null @@ -1,14 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 7 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr -D... dde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/lib -D... cde13514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share -D... cde23514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear -D... cde43514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr/share/clear/bundles -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 10 /usr/share/clear/bundles/os-core -F... 1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 30 /usr/lib/os-release diff --git a/test/functional/update/newest-ghosted/web-dir/30/Manifest.test-bundle2 b/test/functional/update/newest-ghosted/web-dir/30/Manifest.test-bundle2 deleted file mode 100644 index b88929fd..00000000 --- a/test/functional/update/newest-ghosted/web-dir/30/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 30 -previous: 20 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... b85f1dc2c2317a20f47a36d3257313b131124ffa6d4f19bb060d43014fd386b0 20 /usr/share/clear/bundles/test-bundle2 -.g.. 0000000000000000000000000000000000000000000000000000000000000000 30 /testfile diff --git a/test/functional/update/newest-ghosted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 b/test/functional/update/newest-ghosted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 deleted file mode 100644 index 9e48031d..00000000 --- a/test/functional/update/newest-ghosted/web-dir/30/staged/1c1efd10467cbc1dddd8e63c3ef4d9099f36418ed5372d080a1bf0f03a49ab05 +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=30 diff --git a/test/functional/update/newest-ghosted/web-dir/version/formatstaging/latest b/test/functional/update/newest-ghosted/web-dir/version/formatstaging/latest deleted file mode 100644 index 64bb6b74..00000000 --- a/test/functional/update/newest-ghosted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -30 diff --git a/test/functional/update/re-update-bad-os-release/format b/test/functional/update/re-update-bad-os-release/format deleted file mode 100644 index 00750edc..00000000 --- a/test/functional/update/re-update-bad-os-release/format +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/test/functional/update/re-update-bad-os-release/lines-checked b/test/functional/update/re-update-bad-os-release/lines-checked deleted file mode 100644 index 6f66de49..00000000 --- a/test/functional/update/re-update-bad-os-release/lines-checked +++ /dev/null @@ -1,17 +0,0 @@ -Update started. -Preparing to update from 10 to 20 -Statistics for going from version 10 to version 20: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 2 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -2 files were not in a pack -Update successful. System updated from version 10 to version 20 -ERROR: Inconsistency between version files, exiting now. diff --git a/test/functional/update/re-update-bad-os-release/target-dir/usr/lib/os-release b/test/functional/update/re-update-bad-os-release/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/re-update-bad-os-release/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-bad-os-release/test.bats b/test/functional/update/re-update-bad-os-release/test.bats deleted file mode 100755 index 62c62953..00000000 --- a/test/functional/update/re-update-bad-os-release/test.bats +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e -targetfilefmt=512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfile - create_fullfile_tar 20 $targetfilefmt - - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile - create_fullfile_tar 100 $targetfilefmt - - create_manifest_tar 110 MoM - sign_manifest_mom 110 - create_manifest_tar 110 os-core - create_fullfile_tar 110 $targetfile - create_fullfile_tar 110 $targetfilefmt - - # reasonable gitignore rules prohibit "swupd" - # because of how gitignore works, this rule can not be negated unless - # swupd is always treated as a directory. Always just create the directory - # at the beginning of the test and copy format into it. - # https://stackoverflow.com/a/5534865 - sudo mkdir -p "$DIR/target-dir/usr/share/defaults/swupd/" - sudo cp "$DIR/format" "$DIR/target-dir/usr/share/defaults/swupd/format" -} - -teardown() { - clean_tars 10 - clean_tars 20 - clean_tars 20 files - clean_tars 100 - clean_tars 100 files - clean_tars 110 - clean_tars 110 files - revert_chown_root "$DIR/web-dir/20/files/$targetfile" - revert_chown_root "$DIR/web-dir/20/files/$targetfilefmt" - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - revert_chown_root "$DIR/web-dir/100/files/$targetfilefmt" - revert_chown_root "$DIR/web-dir/110/files/$targetfile" - revert_chown_root "$DIR/web-dir/110/files/$targetfilefmt" - sudo rm -rf "$DIR/target-dir/usr/bin/" -} - -@test "update re-update bad os-release" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS_NO_FMT" - - [ "$status" -eq 1 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.MoM b/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.MoM deleted file mode 100644 index 9e692b1f..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 876b4ad42d8bc7a678224ef53a9b8961bc4eef6492535ab9c54ae15f5ef06f10 10 os-core diff --git a/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.os-core b/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.os-core deleted file mode 100644 index 225ed4f2..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin -F... c311a3c3d00f9b10a0aad810de58f66e40137bcc633e1115bd90389f8ae6bffc 10 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.MoM b/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.MoM deleted file mode 100644 index 1052d30e..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 4 -version: 100 -previous: 20 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 93b9077a69198ab002436917dafbc0ade9953e1a42d3c646fa999e26e56450cd 100 os-core diff --git a/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.os-core b/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.os-core deleted file mode 100644 index 143a972f..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 4 -version: 100 -previous: 20 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 100 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-bad-os-release/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-bad-os-release/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-bad-os-release/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-bad-os-release/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.MoM b/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.MoM deleted file mode 100644 index 6bfaafd8..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 4 -version: 110 -previous: 100 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 9fe8de4c13cda866bc2ac147433aac22df58b72dcccfd7ecf987bf369e7e7c76 110 os-core diff --git a/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.os-core b/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.os-core deleted file mode 100644 index 2eaf156b..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/110/Manifest.os-core +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 4 -version: 110 -previous: 100 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 110 /usr/bin -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 110 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-bad-os-release/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-bad-os-release/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-bad-os-release/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-bad-os-release/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.MoM b/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.MoM deleted file mode 100644 index a25b5822..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... daf943e78b505761e2f55cf0013aba577b78155918b1ea75161c9c8554827fac 20 os-core diff --git a/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.os-core b/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.os-core deleted file mode 100644 index b44d1197..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 20 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-bad-os-release/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-bad-os-release/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-bad-os-release/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-bad-os-release/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-bad-os-release/web-dir/version/format3/latest b/test/functional/update/re-update-bad-os-release/web-dir/version/format3/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/version/format3/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/update/re-update-bad-os-release/web-dir/version/format4/latest b/test/functional/update/re-update-bad-os-release/web-dir/version/format4/latest deleted file mode 100644 index bc6298e8..00000000 --- a/test/functional/update/re-update-bad-os-release/web-dir/version/format4/latest +++ /dev/null @@ -1 +0,0 @@ -110 diff --git a/test/functional/update/re-update-required/format b/test/functional/update/re-update-required/format deleted file mode 100644 index 00750edc..00000000 --- a/test/functional/update/re-update-required/format +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/test/functional/update/re-update-required/lines-checked b/test/functional/update/re-update-required/lines-checked deleted file mode 100644 index 56910625..00000000 --- a/test/functional/update/re-update-required/lines-checked +++ /dev/null @@ -1,32 +0,0 @@ -Update started. -Preparing to update from 10 to 20 -Statistics for going from version 10 to version 20: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 3 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -3 files were not in a pack -Update successful. System updated from version 10 to version 20 -Update started. -Preparing to update from 100 to 110 -Statistics for going from version 100 to version 110: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 3 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 100 to version 110 diff --git a/test/functional/update/re-update-required/os-release b/test/functional/update/re-update-required/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/re-update-required/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-required/target-dir/usr/lib/os-release b/test/functional/update/re-update-required/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/re-update-required/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-required/test.bats b/test/functional/update/re-update-required/test.bats deleted file mode 100755 index d6bd8a1c..00000000 --- a/test/functional/update/re-update-required/test.bats +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e -targetfilecross=938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e -targetfile110=82dd2d70ab95d9500469b4ba0ee12dcda50aa566263a70b52518e5bc3ab6e3c4 -targetfilefmt=512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfilecross - create_fullfile_tar 20 $targetfile - create_fullfile_tar 20 $targetfilefmt - - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfilecross - create_fullfile_tar 100 $targetfile - create_fullfile_tar 100 $targetfilefmt - - create_manifest_tar 110 MoM - sign_manifest_mom 110 - create_manifest_tar 110 os-core - create_fullfile_tar 110 $targetfile110 - create_fullfile_tar 110 $targetfile - create_fullfile_tar 110 $targetfilefmt - - # reasonable gitignore rules prohibit "swupd" - # because of how gitignore works, this rule can not be negated unless - # swupd is always treated as a directory. Always just create the directory - # at the beginning of the test and copy format into it. - # https://stackoverflow.com/a/5534865 - sudo mkdir -p "$DIR/target-dir/usr/share/defaults/swupd/" - sudo cp "$DIR/format" "$DIR/target-dir/usr/share/defaults/swupd/format" - sudo cp "$DIR/os-release" "$DIR/target-dir/usr/lib/os-release" -} - -teardown() { - clean_tars 10 - clean_tars 20 - clean_tars 20 files - clean_tars 100 - clean_tars 100 files - clean_tars 110 - clean_tars 110 files - revert_chown_root "$DIR/web-dir/20/files/$targetfile" - revert_chown_root "$DIR/web-dir/20/files/$targetfilecross" - revert_chown_root "$DIR/web-dir/20/files/$targetfilefmt" - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - revert_chown_root "$DIR/web-dir/100/files/$targetfilecross" - revert_chown_root "$DIR/web-dir/100/files/$targetfilefmt" - revert_chown_root "$DIR/web-dir/110/files/$targetfile" - revert_chown_root "$DIR/web-dir/110/files/$targetfile110" - revert_chown_root "$DIR/web-dir/110/files/$targetfilefmt" - sudo cp "$DIR/format" "$DIR/target-dir/usr/share/defaults/swupd/format" - sudo cp "$DIR/os-release" "$DIR/target-dir/usr/lib/os-release" - sudo rm -rf "$DIR/target-dir/usr/bin/" -} - -@test "update re-update required" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS_NO_FMT" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/re-update-required/web-dir/10/Manifest.MoM b/test/functional/update/re-update-required/web-dir/10/Manifest.MoM deleted file mode 100644 index c6e65692..00000000 --- a/test/functional/update/re-update-required/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... eb5d9f18bfdaff98e69a66dc881e7cd784c603fbfc086a9cc405527c846d884f 10 os-core diff --git a/test/functional/update/re-update-required/web-dir/10/Manifest.os-core b/test/functional/update/re-update-required/web-dir/10/Manifest.os-core deleted file mode 100644 index ffcaf453..00000000 --- a/test/functional/update/re-update-required/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 3 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin -F... 12280923053f5b0eac5939521b1be04c4bb1947dc8768241889ef21243d042d9 10 /usr/lib/os-release -F... c311a3c3d00f9b10a0aad810de58f66e40137bcc633e1115bd90389f8ae6bffc 10 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-required/web-dir/100/Manifest.MoM b/test/functional/update/re-update-required/web-dir/100/Manifest.MoM deleted file mode 100644 index a27d9075..00000000 --- a/test/functional/update/re-update-required/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 4 -version: 100 -previous: 20 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... e4b1af41ffa052432402121c30d7aedd0a38fc93567c4ebec2c85f1d6c0e6231 100 os-core diff --git a/test/functional/update/re-update-required/web-dir/100/Manifest.os-core b/test/functional/update/re-update-required/web-dir/100/Manifest.os-core deleted file mode 100644 index 544684bb..00000000 --- a/test/functional/update/re-update-required/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 4 -version: 100 -previous: 20 -filecount: 3 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin -F... 938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e 100 /usr/lib/os-release -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 100 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-required/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-required/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-required/web-dir/100/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-required/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-required/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-required/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-required/web-dir/100/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e b/test/functional/update/re-update-required/web-dir/100/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e deleted file mode 100644 index e65580ca..00000000 --- a/test/functional/update/re-update-required/web-dir/100/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=100 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-required/web-dir/110/Manifest.MoM b/test/functional/update/re-update-required/web-dir/110/Manifest.MoM deleted file mode 100644 index 5ff14c00..00000000 --- a/test/functional/update/re-update-required/web-dir/110/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 4 -version: 110 -previous: 100 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... bd2f27930b818858732e2c6b9712b793e8083af36f54f7081b72c56667aa1354 110 os-core diff --git a/test/functional/update/re-update-required/web-dir/110/Manifest.os-core b/test/functional/update/re-update-required/web-dir/110/Manifest.os-core deleted file mode 100644 index f52f047d..00000000 --- a/test/functional/update/re-update-required/web-dir/110/Manifest.os-core +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 4 -version: 110 -previous: 100 -filecount: 3 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 110 /usr/bin -F... 82dd2d70ab95d9500469b4ba0ee12dcda50aa566263a70b52518e5bc3ab6e3c4 110 /usr/lib/os-release -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 110 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-required/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-required/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-required/web-dir/110/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-required/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-required/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-required/web-dir/110/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-required/web-dir/110/files/82dd2d70ab95d9500469b4ba0ee12dcda50aa566263a70b52518e5bc3ab6e3c4 b/test/functional/update/re-update-required/web-dir/110/files/82dd2d70ab95d9500469b4ba0ee12dcda50aa566263a70b52518e5bc3ab6e3c4 deleted file mode 100644 index b316fa3f..00000000 --- a/test/functional/update/re-update-required/web-dir/110/files/82dd2d70ab95d9500469b4ba0ee12dcda50aa566263a70b52518e5bc3ab6e3c4 +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=110 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-required/web-dir/20/Manifest.MoM b/test/functional/update/re-update-required/web-dir/20/Manifest.MoM deleted file mode 100644 index 227e3e29..00000000 --- a/test/functional/update/re-update-required/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 95975ab39fe7f87207757b3bb0b1282a0f588f9838877824545545de44beaa71 20 os-core diff --git a/test/functional/update/re-update-required/web-dir/20/Manifest.os-core b/test/functional/update/re-update-required/web-dir/20/Manifest.os-core deleted file mode 100644 index 805db3f6..00000000 --- a/test/functional/update/re-update-required/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 3 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin -F... 938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e 20 /usr/lib/os-release -F... 512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 20 /usr/share/defaults/swupd/format diff --git a/test/functional/update/re-update-required/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 b/test/functional/update/re-update-required/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 deleted file mode 100644 index b8626c4c..00000000 --- a/test/functional/update/re-update-required/web-dir/20/files/512b7187c47b9c8166b61b160fc57297b0779ce4cdeae1eae057bacb23618357 +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/functional/update/re-update-required/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/re-update-required/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/re-update-required/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/re-update-required/web-dir/20/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e b/test/functional/update/re-update-required/web-dir/20/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e deleted file mode 100644 index e65580ca..00000000 --- a/test/functional/update/re-update-required/web-dir/20/files/938b2569476c3cf665afa9ea5ac2e97bace1e098b8c7f913db0f00e6b96c612e +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=100 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/re-update-required/web-dir/version/format3/latest b/test/functional/update/re-update-required/web-dir/version/format3/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/update/re-update-required/web-dir/version/format3/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/update/re-update-required/web-dir/version/format4/latest b/test/functional/update/re-update-required/web-dir/version/format4/latest deleted file mode 100644 index bc6298e8..00000000 --- a/test/functional/update/re-update-required/web-dir/version/format4/latest +++ /dev/null @@ -1 +0,0 @@ -110 diff --git a/test/functional/update/rename-ghosted/lines-checked b/test/functional/update/rename-ghosted/lines-checked deleted file mode 100644 index daf7c961..00000000 --- a/test/functional/update/rename-ghosted/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 20 -Extracting os-core pack for version 20 -Statistics for going from version 10 to version 20: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 2 - deleted files : 2 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 20 diff --git a/test/functional/update/rename-ghosted/target-dir/bar b/test/functional/update/rename-ghosted/target-dir/bar deleted file mode 100644 index 190423f8..00000000 --- a/test/functional/update/rename-ghosted/target-dir/bar +++ /dev/null @@ -1,100 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 diff --git a/test/functional/update/rename-ghosted/target-dir/bat b/test/functional/update/rename-ghosted/target-dir/bat deleted file mode 100644 index 27b40f37..00000000 --- a/test/functional/update/rename-ghosted/target-dir/bat +++ /dev/null @@ -1,99 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 20 diff --git a/test/functional/update/rename-ghosted/target-dir/baz b/test/functional/update/rename-ghosted/target-dir/baz deleted file mode 100644 index 06ed4e5a..00000000 --- a/test/functional/update/rename-ghosted/target-dir/baz +++ /dev/null @@ -1,99 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 10 diff --git a/test/functional/update/rename-ghosted/target-dir/foo b/test/functional/update/rename-ghosted/target-dir/foo deleted file mode 100644 index 190423f8..00000000 --- a/test/functional/update/rename-ghosted/target-dir/foo +++ /dev/null @@ -1,100 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 diff --git a/test/functional/update/rename-ghosted/target-dir/usr/lib/os-release b/test/functional/update/rename-ghosted/target-dir/usr/lib/os-release deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/rename-ghosted/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/rename-ghosted/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/rename-ghosted/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/rename-ghosted/test.bats b/test/functional/update/rename-ghosted/test.bats deleted file mode 100755 index cbb5d6b0..00000000 --- a/test/functional/update/rename-ghosted/test.bats +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_state_dir - clean_target_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - set_os_release 10 - chown_root -R "$DIR/target-dir" "$DIR/web-dir" - unpack_target_from_manifest 10 MoM - unpack_target_from_manifest 10 os-core - sudo tar -C "$DIR/web-dir/20" -cf "$DIR/web-dir/20/pack-os-core-from-10.tar" delta/ staged/ -} - -teardown() { - revert_chown_root -R "$DIR/target-dir" "$DIR/web-dir" -} - -@test "update rename ghosted file" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ $status -eq 0 ] - check_lines "$output" - - # all the files should still exist, including the ghosted ones - [ -e "$DIR/target-dir/bar" ] - [ -e "$DIR/target-dir/foo" ] - [ -e "$DIR/target-dir/bat" ] - [ -e "$DIR/target-dir/baz" ] - -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/rename-ghosted/web-dir/10/Manifest.MoM b/test/functional/update/rename-ghosted/web-dir/10/Manifest.MoM deleted file mode 100644 index 7b27c1d9..00000000 --- a/test/functional/update/rename-ghosted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1505693993 -contentsize: 0 - -M... d904b539bd1b18baf1309146e780f952851052203c1fef338b860ec0a47ac614 10 os-core diff --git a/test/functional/update/rename-ghosted/web-dir/10/Manifest.os-core b/test/functional/update/rename-ghosted/web-dir/10/Manifest.os-core deleted file mode 100644 index 3ea87a42..00000000 --- a/test/functional/update/rename-ghosted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,17 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 9 -timestamp: 1505693993 -contentsize: 5722 -status: ACTIVE - -F... fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 10 /baz -F... 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 10 /foo -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -F... e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f 10 /usr/lib/os-release -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/rename-ghosted/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/rename-ghosted/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 190423f8..00000000 --- a/test/functional/update/rename-ghosted/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 +++ /dev/null @@ -1,100 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 diff --git a/test/functional/update/rename-ghosted/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 b/test/functional/update/rename-ghosted/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/rename-ghosted/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f b/test/functional/update/rename-ghosted/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/update/rename-ghosted/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/update/rename-ghosted/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 b/test/functional/update/rename-ghosted/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 deleted file mode 100644 index 06ed4e5a..00000000 --- a/test/functional/update/rename-ghosted/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 +++ /dev/null @@ -1,99 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 10 diff --git a/test/functional/update/rename-ghosted/web-dir/20/Manifest.MoM b/test/functional/update/rename-ghosted/web-dir/20/Manifest.MoM deleted file mode 100644 index 5ae18907..00000000 --- a/test/functional/update/rename-ghosted/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1505693993 -contentsize: 0 - -M... cde1ce5ec0e036b3a2d11a8c7f5a38286d3583ba8fd5e0c533307bd57cfa8e63 20 os-core diff --git a/test/functional/update/rename-ghosted/web-dir/20/Manifest.os-core b/test/functional/update/rename-ghosted/web-dir/20/Manifest.os-core deleted file mode 100644 index 7666e19d..00000000 --- a/test/functional/update/rename-ghosted/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,19 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 11 -timestamp: 1505693993 -contentsize: 602 -status: ACTIVE - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core -F..r 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 20 /bar -F..r c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 20 /bat -.g.r c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 20 /baz -.g.r 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 20 /foo -F... 43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a 20 /usr/lib/os-release diff --git a/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 2f0bb3b9..00000000 Binary files a/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 and /dev/null differ diff --git a/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 b/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 deleted file mode 100644 index f14a2392..00000000 Binary files a/test/functional/update/rename-ghosted/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 and /dev/null differ diff --git a/test/functional/update/rename-ghosted/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a b/test/functional/update/rename-ghosted/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/rename-ghosted/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/rename-ghosted/web-dir/version/formatstaging/latest b/test/functional/update/rename-ghosted/web-dir/version/formatstaging/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/update/rename-ghosted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/update/rename/.gitignore b/test/functional/update/rename/.gitignore deleted file mode 100644 index 684c6d7c..00000000 --- a/test/functional/update/rename/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target-dir/ diff --git a/test/functional/update/rename/lines-checked b/test/functional/update/rename/lines-checked deleted file mode 100644 index daf7c961..00000000 --- a/test/functional/update/rename/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 20 -Extracting os-core pack for version 20 -Statistics for going from version 10 to version 20: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 2 - deleted files : 2 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 20 diff --git a/test/functional/update/rename/test.bats b/test/functional/update/rename/test.bats deleted file mode 100755 index 0e9fed88..00000000 --- a/test/functional/update/rename/test.bats +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_state_dir - clean_target_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - set_os_release 10 - chown_root -R "$DIR/target-dir" "$DIR/web-dir" - unpack_target_from_manifest 10 MoM - unpack_target_from_manifest 10 os-core - sudo tar -C "$DIR/web-dir/20" -cf "$DIR/web-dir/20/pack-os-core-from-10.tar" delta/ staged/ - echo "CMD: $SWUPD update $SWUPD_OPTS" -} - -teardown() { - clean_tars 10 - clean_tars 20 - revert_chown_root -R "$DIR/web-dir" -} - -@test "update simple rename" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - check_lines "$output" - - [ -e "$DIR/target-dir/bar" ] - [ ! -e "$DIR/target-dir/foo" ] - [ -e "$DIR/target-dir/bat" ] - [ ! -e "$DIR/target-dir/baz" ] - -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/rename/web-dir/10/Manifest.MoM b/test/functional/update/rename/web-dir/10/Manifest.MoM deleted file mode 100644 index 7b27c1d9..00000000 --- a/test/functional/update/rename/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1505693993 -contentsize: 0 - -M... d904b539bd1b18baf1309146e780f952851052203c1fef338b860ec0a47ac614 10 os-core diff --git a/test/functional/update/rename/web-dir/10/Manifest.os-core b/test/functional/update/rename/web-dir/10/Manifest.os-core deleted file mode 100644 index 3ea87a42..00000000 --- a/test/functional/update/rename/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,17 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 9 -timestamp: 1505693993 -contentsize: 5722 -status: ACTIVE - -F... fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 10 /baz -F... 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 10 /foo -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -F... e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f 10 /usr/lib/os-release -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core diff --git a/test/functional/update/rename/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/rename/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 190423f8..00000000 --- a/test/functional/update/rename/web-dir/10/staged/0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 +++ /dev/null @@ -1,100 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 diff --git a/test/functional/update/rename/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 b/test/functional/update/rename/web-dir/10/staged/28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/rename/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f b/test/functional/update/rename/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/update/rename/web-dir/10/staged/e6b5b316f2b470fc5d7a22caf4e7f6c8384a26ac8aacd80ccde5a6bd3838e87f +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/update/rename/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 b/test/functional/update/rename/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 deleted file mode 100644 index 06ed4e5a..00000000 --- a/test/functional/update/rename/web-dir/10/staged/fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334 +++ /dev/null @@ -1,99 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 10 diff --git a/test/functional/update/rename/web-dir/20/Manifest.MoM b/test/functional/update/rename/web-dir/20/Manifest.MoM deleted file mode 100644 index 417876f4..00000000 --- a/test/functional/update/rename/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1505693993 -contentsize: 0 - -M... be7798a95e86f9b89c64c8db64cf93d35c61f9215d01b7f5240faa62b85d4445 20 os-core diff --git a/test/functional/update/rename/web-dir/20/Manifest.os-core b/test/functional/update/rename/web-dir/20/Manifest.os-core deleted file mode 100644 index 5f030d4b..00000000 --- a/test/functional/update/rename/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,19 +0,0 @@ -MANIFEST 3 -version: 20 -previous: 10 -filecount: 11 -timestamp: 1505693993 -contentsize: 602 -status: ACTIVE - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/share/clear/bundles -F... 28cb7c6cad23920f344157f48ae353caca34e9a2f5cff934a4fdaaf7509f2062 10 /usr/share/clear/bundles/os-core -F..r 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 20 /bar -F..r c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 20 /bat -.d.r c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 20 /baz -.d.r 0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 20 /foo -F... 43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a 20 /usr/lib/os-release diff --git a/test/functional/update/rename/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 b/test/functional/update/rename/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 deleted file mode 100644 index 2f0bb3b9..00000000 Binary files a/test/functional/update/rename/web-dir/20/delta/10-20-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50-0c00735e7bf78ac9063de74a9c6712052cdebd05ae5d4a4b76a22c8395d6aa50 and /dev/null differ diff --git a/test/functional/update/rename/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 b/test/functional/update/rename/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 deleted file mode 100644 index f14a2392..00000000 Binary files a/test/functional/update/rename/web-dir/20/delta/10-20-fdfec2695a18d214f80ef9fa6edde7b9fd64312b6be61f73429c39389e1d1334-c21cc55db744a24867470b7343bdc6bde1c19e4b5a782fd82c84a86b55de6d54 and /dev/null differ diff --git a/test/functional/update/rename/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a b/test/functional/update/rename/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/update/rename/web-dir/20/staged/43fff5857537e90559eebe9acce089110b12e62f52b057d57ccdd310f612779a +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/update/rename/web-dir/version/formatstaging/latest b/test/functional/update/rename/web-dir/version/formatstaging/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/update/rename/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/update/skip-scripts/lines-checked b/test/functional/update/skip-scripts/lines-checked deleted file mode 100644 index d0175036..00000000 --- a/test/functional/update/skip-scripts/lines-checked +++ /dev/null @@ -1,17 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -WARNING: post-update helper scripts skipped due to --no-scripts argument -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/skip-scripts/target-dir/usr/lib/os-release b/test/functional/update/skip-scripts/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/skip-scripts/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/skip-scripts/test.bats b/test/functional/update/skip-scripts/test.bats deleted file mode 100755 index 6f211e50..00000000 --- a/test/functional/update/skip-scripts/test.bats +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "update skip post-update scripts" { - run sudo sh -c "$SWUPD update --no-scripts $SWUPD_OPTS" - - # Should still be successful - [ "$status" -eq 0 ] - # Test that the warning is printed - check_lines "$output" - # The file should still be added - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/skip-scripts/web-dir/10/Manifest.MoM b/test/functional/update/skip-scripts/web-dir/10/Manifest.MoM deleted file mode 100644 index 5f3034d9..00000000 --- a/test/functional/update/skip-scripts/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 624af832ff42f0b0592817db4b1bff9672d791592961605cf6e8dc8f5badf4e0 10 os-core diff --git a/test/functional/update/skip-scripts/web-dir/10/Manifest.os-core b/test/functional/update/skip-scripts/web-dir/10/Manifest.os-core deleted file mode 100644 index dfb192ab..00000000 --- a/test/functional/update/skip-scripts/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin diff --git a/test/functional/update/skip-scripts/web-dir/100/Manifest.MoM b/test/functional/update/skip-scripts/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/update/skip-scripts/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/update/skip-scripts/web-dir/100/Manifest.os-core b/test/functional/update/skip-scripts/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/skip-scripts/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/skip-scripts/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/skip-scripts/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/skip-scripts/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/skip-scripts/web-dir/version/formatstaging/latest b/test/functional/update/skip-scripts/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/skip-scripts/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/skip-verified-fullfiles/lines-checked b/test/functional/update/skip-verified-fullfiles/lines-checked deleted file mode 100644 index 0f7130a5..00000000 --- a/test/functional/update/skip-verified-fullfiles/lines-checked +++ /dev/null @@ -1,13 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/skip-verified-fullfiles/target-dir/foo b/test/functional/update/skip-verified-fullfiles/target-dir/foo deleted file mode 100644 index 257cc564..00000000 --- a/test/functional/update/skip-verified-fullfiles/target-dir/foo +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/test/functional/update/skip-verified-fullfiles/target-dir/usr/lib/os-release b/test/functional/update/skip-verified-fullfiles/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/skip-verified-fullfiles/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/skip-verified-fullfiles/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/skip-verified-fullfiles/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/skip-verified-fullfiles/target-dir/usr/share/clear/bundles/test-bundle b/test/functional/update/skip-verified-fullfiles/target-dir/usr/share/clear/bundles/test-bundle deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/skip-verified-fullfiles/test.bats b/test/functional/update/skip-verified-fullfiles/test.bats deleted file mode 100755 index db8e199f..00000000 --- a/test/functional/update/skip-verified-fullfiles/test.bats +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 test-bundle - chown_root "$DIR/target-dir/foo" -} - -teardown() { - clean_tars 10 - clean_tars 100 - revert_chown_root "$DIR/target-dir/foo" -} - -@test "update fullfile download skipped when hash verifies correctly" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - - # changed file (hash is the same, but version changed) - [ -f "$DIR/target-dir/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.MoM b/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.MoM deleted file mode 100644 index 1777f1d0..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 1d951049819a561cafa046f5350511d6a132f0e821c342ebe23908911888d01f 10 os-core -M... 0f4d9003471699f2660bb424fac09618d6679d659ce6b471622a440410c9cd8c 10 test-bundle diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.os-core b/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.os-core deleted file mode 100644 index 410ebbfc..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.test-bundle b/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.test-bundle deleted file mode 100644 index a84e2b65..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/10/Manifest.test-bundle +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... a0d1fedf40ed8ae04757956cd3013e054134f4fd4119b74067ee062eb5bbbf61 10 /foo diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.MoM b/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.MoM deleted file mode 100644 index fc0bf978..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 1d951049819a561cafa046f5350511d6a132f0e821c342ebe23908911888d01f 10 os-core -M... 4a53f6e18e9abc81eb1341e1ca496b6213d81fe85e9455366f8e970f84d34d0c 100 test-bundle diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.test-bundle b/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.test-bundle deleted file mode 100644 index 0dbdbeab..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/100/Manifest.test-bundle +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... a0d1fedf40ed8ae04757956cd3013e054134f4fd4119b74067ee062eb5bbbf61 100 /foo diff --git a/test/functional/update/skip-verified-fullfiles/web-dir/version/formatstaging/latest b/test/functional/update/skip-verified-fullfiles/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/skip-verified-fullfiles/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/slow-server/lines-checked b/test/functional/update/slow-server/lines-checked deleted file mode 100644 index bf1b942f..00000000 --- a/test/functional/update/slow-server/lines-checked +++ /dev/null @@ -1,21 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -REGEXP:Error for .*/update/slow-server/state/pack-os-core-from-10-to-100.tar download: Response 206 - No error -REGEXP:Starting download retry #1 for .*100/pack-os-core-from-10.tar -REGEXP:Error for .*/slow-server/state/pack-os-core-from-10-to-100.tar download: Response 200 - Requested range was not delivered by the server -Range command not supported by server, download resume disabled. -REGEXP:Starting download retry #2 for .*100/pack-os-core-from-10.tar -Extracting os-core pack for version 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/slow-server/target-dir/usr/lib/os-release b/test/functional/update/slow-server/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/slow-server/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/slow-server/test.bats b/test/functional/update/slow-server/test.bats deleted file mode 100755 index 3260a735..00000000 --- a/test/functional/update/slow-server/test.bats +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -server_pid="" -port="" - -targetfile="6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e" - -setup() { - # Skip this test if not running in Travis CI, because test takes too long for - # local development. To run this locally do: TRAVIS=true make check - if [ -z "${TRAVIS}" ]; then - skip "Skipping slow test for local development, test only runs in CI" - fi - - for i in $(seq 8081 8181); do - pushd "$DIR" - "./server.py" $i & - sleep .5 - server_pid=$! - if [ -d /proc/$server_pid ]; then - port=$i - break - fi - popd - done - - clean_test_dir - - #create partial tarball - mkdir "$DIR/state/" - chown_root "$DIR/state" - sudo chmod 700 "$DIR/state" - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - - # create_pack_tar 10 100 os-core $targetfile - chown_root "$DIR/web-dir/100/staged/$targetfile" - tar -C "$DIR/web-dir/100" -cjf "$DIR/web-dir/100/pack-os-core-from-10.tar" --exclude=staged/$targetfile/* staged/$targetfile -} - -teardown() { - # teardown only if in travis CI - if [ -n "${TRAVIS}" ]; then - sudo rm -rf "$DIR/target-dir/usr/bin" - kill $server_pid - fi -} - -@test "update --download with a slow server" { - slow_opts="-u http://localhost:$port/" - - # wait until server becomes available by expecting a successful curl - for i in $(seq 1 10); do - run curl http://localhost:$port/ - if [ "$status" -ne 0 ]; then - sleep .5 - continue - else - break - fi - done - - run sudo sh -c "$SWUPD update $slow_opts $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/slow-server/web-dir/10/Manifest.MoM b/test/functional/update/slow-server/web-dir/10/Manifest.MoM deleted file mode 100644 index 7f115843..00000000 --- a/test/functional/update/slow-server/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core diff --git a/test/functional/update/slow-server/web-dir/10/Manifest.os-core b/test/functional/update/slow-server/web-dir/10/Manifest.os-core deleted file mode 100644 index ce24deed..00000000 --- a/test/functional/update/slow-server/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin diff --git a/test/functional/update/slow-server/web-dir/100/Manifest.MoM b/test/functional/update/slow-server/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/update/slow-server/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/update/slow-server/web-dir/100/Manifest.os-core b/test/functional/update/slow-server/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/slow-server/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/slow-server/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/slow-server/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/slow-server/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/slow-server/web-dir/version/formatstaging/latest b/test/functional/update/slow-server/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/slow-server/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/statedir-bad-hash/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 b/test/functional/update/statedir-bad-hash/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 deleted file mode 100644 index 9241b676..00000000 --- a/test/functional/update/statedir-bad-hash/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 +++ /dev/null @@ -1 +0,0 @@ -test file with changed content diff --git a/test/functional/update/statedir-bad-hash/lines-checked b/test/functional/update/statedir-bad-hash/lines-checked deleted file mode 100644 index ccf38195..00000000 --- a/test/functional/update/statedir-bad-hash/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 0 - new files : 1 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/statedir-bad-hash/target-dir/usr/lib/os-release b/test/functional/update/statedir-bad-hash/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/statedir-bad-hash/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/statedir-bad-hash/test.bats b/test/functional/update/statedir-bad-hash/test.bats deleted file mode 100755 index 25c9defe..00000000 --- a/test/functional/update/statedir-bad-hash/test.bats +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 - -setup() { - clean_test_dir - mkdir -p "$DIR/state/staged" - sudo cp "$DIR/$targetfile" "$DIR/state/staged/$targetfile" - chown_root -R "$DIR/state" - sudo chmod -R 0700 "$DIR/state" - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - sudo rm "$DIR/target-dir/usr/testfile" -} - -@test "update full file with bad hash in state dir" { - # sanity check that the file does not exist in the target-dir before swupd - # puts it there - [ ! -f "$DIR/target-dir/usr/testfile" ] - - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - # swupd should succeed - [ "$status" -eq 0 ] - # no errors are printed for a mismatched hash - check_lines "$output" - # the file exists on the filesystem (it does not exist before the test) - [ -f "$DIR/target-dir/usr/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.MoM b/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.MoM deleted file mode 100644 index 5f3034d9..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 624af832ff42f0b0592817db4b1bff9672d791592961605cf6e8dc8f5badf4e0 10 os-core diff --git a/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.os-core b/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.os-core deleted file mode 100644 index dfb192ab..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin diff --git a/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.MoM b/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.MoM deleted file mode 100644 index 6dd8d7cc..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 92bab1b873cce75e08ee2c3401eeb3096161a780759cc5ad2d0e87a6b17d9f10 100 os-core diff --git a/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.os-core b/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.os-core deleted file mode 100644 index 079f3cec..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 100 /usr/testfile diff --git a/test/functional/update/statedir-bad-hash/web-dir/100/files/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 b/test/functional/update/statedir-bad-hash/web-dir/100/files/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 deleted file mode 100644 index 16b14f5d..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/100/files/ffbe308091534f3b47b876b241166c4c6d0665204977274093f74851380d49b5 +++ /dev/null @@ -1 +0,0 @@ -test file diff --git a/test/functional/update/statedir-bad-hash/web-dir/version/formatstaging/latest b/test/functional/update/statedir-bad-hash/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/statedir-bad-hash/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/status-no-server-content/lines-checked b/test/functional/update/status-no-server-content/lines-checked deleted file mode 100644 index d964c250..00000000 --- a/test/functional/update/status-no-server-content/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Current OS version: 10 -Cannot get the latest server version. Could not reach server diff --git a/test/functional/update/status-no-server-content/target-dir/usr/lib/os-release b/test/functional/update/status-no-server-content/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/status-no-server-content/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/status-no-server-content/test.bats b/test/functional/update/status-no-server-content/test.bats deleted file mode 100755 index dfbc13e1..00000000 --- a/test/functional/update/status-no-server-content/test.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "update --status with no server content" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" - - [ "$status" -eq 2 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/status-no-server-content/web-dir/.gitignore b/test/functional/update/status-no-server-content/web-dir/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/status-no-server-content/web-dir/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/status-no-target-content/lines-checked b/test/functional/update/status-no-target-content/lines-checked deleted file mode 100644 index d17fa75d..00000000 --- a/test/functional/update/status-no-target-content/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Cannot determine current OS version -Latest server version: 100 diff --git a/test/functional/update/status-no-target-content/target-dir/.gitignore b/test/functional/update/status-no-target-content/target-dir/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/status-no-target-content/target-dir/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/status-no-target-content/test.bats b/test/functional/update/status-no-target-content/test.bats deleted file mode 100755 index 1f2c5390..00000000 --- a/test/functional/update/status-no-target-content/test.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "update --status with no target content" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" - - [ "$status" -eq 2 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/status-no-target-content/web-dir/version/formatstaging/latest b/test/functional/update/status-no-target-content/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/status-no-target-content/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/status-version-double-quote/lines-checked b/test/functional/update/status-version-double-quote/lines-checked deleted file mode 100644 index 921de0ce..00000000 --- a/test/functional/update/status-version-double-quote/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Current OS version: 10 -Latest server version: 100 diff --git a/test/functional/update/status-version-double-quote/target-dir/usr/lib/os-release b/test/functional/update/status-version-double-quote/target-dir/usr/lib/os-release deleted file mode 100644 index a31e2cd6..00000000 --- a/test/functional/update/status-version-double-quote/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID="10" -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/status-version-double-quote/test.bats b/test/functional/update/status-version-double-quote/test.bats deleted file mode 100755 index 274bec4f..00000000 --- a/test/functional/update/status-version-double-quote/test.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "update --status with double quote version" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" - - [ "$status" -eq 0 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/status-version-double-quote/web-dir/version/formatstaging/latest b/test/functional/update/status-version-double-quote/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/status-version-double-quote/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/status-version-single-quote/lines-checked b/test/functional/update/status-version-single-quote/lines-checked deleted file mode 100644 index 921de0ce..00000000 --- a/test/functional/update/status-version-single-quote/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Current OS version: 10 -Latest server version: 100 diff --git a/test/functional/update/status-version-single-quote/target-dir/usr/lib/os-release b/test/functional/update/status-version-single-quote/target-dir/usr/lib/os-release deleted file mode 100644 index a5ef67b9..00000000 --- a/test/functional/update/status-version-single-quote/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID='10' -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/status-version-single-quote/test.bats b/test/functional/update/status-version-single-quote/test.bats deleted file mode 100755 index 39361c44..00000000 --- a/test/functional/update/status-version-single-quote/test.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "update --status with single quote version" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" - - [ "$status" -eq 0 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/status-version-single-quote/web-dir/version/formatstaging/latest b/test/functional/update/status-version-single-quote/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/status-version-single-quote/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/status/lines-checked b/test/functional/update/status/lines-checked deleted file mode 100644 index 921de0ce..00000000 --- a/test/functional/update/status/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Current OS version: 10 -Latest server version: 100 diff --git a/test/functional/update/status/target-dir/usr/lib/os-release b/test/functional/update/status/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/status/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/status/test.bats b/test/functional/update/status/test.bats deleted file mode 100755 index 54ffb0d4..00000000 --- a/test/functional/update/status/test.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "update --status" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" - - [ "$status" -eq 0 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/status/web-dir/version/formatstaging/latest b/test/functional/update/status/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/status/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/update-apply-full-file-delta.bats b/test/functional/update/update-apply-full-file-delta.bats new file mode 100755 index 00000000..4de9ce5a --- /dev/null +++ b/test/functional/update/update-apply-full-file-delta.bats @@ -0,0 +1,43 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --update /core + +} + +@test "update use delta pack" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + # make sure the file was updated correctly + fhash=$(get_hash_from_manifest "$WEBDIR"/100/Manifest.os-core /core) + assert_files_equal "$TARGETDIR"/core "$TEST_NAME"/web-dir/100/files/"$fhash" + +} diff --git a/test/functional/update/update-boot-file.bats b/test/functional/update/update-boot-file.bats new file mode 100755 index 00000000..3f415697 --- /dev/null +++ b/test/functional/update/update-boot-file.bats @@ -0,0 +1,41 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --add /usr/lib/kernel/testfile + +} + +@test "update add boot file" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 4 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} diff --git a/test/functional/update/update-boot-skip.bats b/test/functional/update/update-boot-skip.bats new file mode 100755 index 00000000..252e1562 --- /dev/null +++ b/test/functional/update/update-boot-skip.bats @@ -0,0 +1,42 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --add /usr/lib/kernel/testfile + +} + +@test "update add boot file with --no-boot-update" { + + run sudo sh -c "$SWUPD update -b $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 4 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + WARNING: boot files update skipped due to --no-boot-update argument + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} diff --git a/test/functional/update_v2/update-client-certificate.bats b/test/functional/update/update-client-certificate.bats similarity index 100% rename from test/functional/update_v2/update-client-certificate.bats rename to test/functional/update/update-client-certificate.bats diff --git a/test/functional/update/update-delta-without-rename-flag.bats b/test/functional/update/update-delta-without-rename-flag.bats new file mode 100755 index 00000000..4aabb8e8 --- /dev/null +++ b/test/functional/update/update-delta-without-rename-flag.bats @@ -0,0 +1,42 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" os-core --rename /core /foo + +} + +@test "using delta without a rename flag in the manifest" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 20 + Downloading packs... + Extracting os-core pack for version 20 + Statistics for going from version 10 to version 20: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 1 + deleted files : 1 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 20 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/foo + assert_file_not_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-download.bats b/test/functional/update/update-download.bats new file mode 100755 index 00000000..e2472d83 --- /dev/null +++ b/test/functional/update/update-download.bats @@ -0,0 +1,37 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --add /foo + +} + +@test "update only download packs" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --download" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 1 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Calling post-update helper scripts. + EOM + ) + assert_is_output "$expected_output" + assert_file_not_exists "$TARGETDIR"/foo +} + diff --git a/test/functional/update/update-include-old-bundle-with-tracked-file.bats b/test/functional/update/update-include-old-bundle-with-tracked-file.bats new file mode 100755 index 00000000..edc1a24e --- /dev/null +++ b/test/functional/update/update-include-old-bundle-with-tracked-file.bats @@ -0,0 +1,54 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -r "$TEST_NAME" + create_bundle -n test-bundle1 -f /tracked_file,/foo/ftb1 "$TEST_NAME" # not installed + create_bundle -L -n test-bundle2 -f /ftb2 "$TEST_NAME" + create_bundle -L -n test-bundle3 -f /ftb3 "$TEST_NAME" + tracked_file=$(get_hash_from_manifest "$TEST_NAME"/web-dir/10/Manifest.test-bundle1 /tracked_file) + create_version -r "$TEST_NAME" 20 10 + create_version -r "$TEST_NAME" 30 20 + update_bundle "$TEST_NAME" test-bundle3 --add /tracked_file:"$TEST_NAME"/web-dir/10/files/"$tracked_file" + update_bundle "$TEST_NAME" test-bundle2 --header-only + add_dependency_to_manifest "$WEBDIR"/30/Manifest.test-bundle2 test-bundle1 + set_current_version "$TEST_NAME" 20 + +} + +@test "update include a bundle from an older release" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 20 to 30 + Downloading packs... + Extracting os-core pack for version 30 + Extracting test-bundle3 pack for version 30 + Statistics for going from version 20 to version 30: + changed bundles : 3 + new bundles : 0 + deleted bundles : 0 + changed files : 2 + new files : 4 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + 3 files were not in a pack + Update successful. System updated from version 20 to version 30 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + assert_file_exists "$TARGETDIR"/tracked_file + assert_file_exists "$TARGETDIR"/foo/ftb1 + assert_file_exists "$TARGETDIR"/ftb3 + +} diff --git a/test/functional/update/update-include-old-bundle.bats b/test/functional/update/update-include-old-bundle.bats new file mode 100755 index 00000000..707d03cc --- /dev/null +++ b/test/functional/update/update-include-old-bundle.bats @@ -0,0 +1,49 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle1 -f /testfile1 "$TEST_NAME" + create_bundle -n test-bundle2 -f /testfile2 "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle1 --update /testfile1 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle1 test-bundle2 + +} + +@test "update include a bundle from an older release" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting test-bundle1 pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 2 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + 2 files were not in a pack + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + # changed files + assert_file_exists "$TARGETDIR"/testfile1 + # new file + assert_file_exists "$TARGETDIR"/testfile2 + +} + diff --git a/test/functional/update/update-include.bats b/test/functional/update/update-include.bats new file mode 100755 index 00000000..07731c6f --- /dev/null +++ b/test/functional/update/update-include.bats @@ -0,0 +1,80 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + # create the test env with two bundles (one installed) + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle1 -f /foo/testfile1 "$TEST_NAME" + create_bundle -n test-bundle2 -f /bar/testfile2 "$TEST_NAME" + # create a new version 100 + create_version -p "$TEST_NAME" 100 10 + # modify test-bundle1 and test-bundle2 + update_bundle "$TEST_NAME" test-bundle1 --update /foo/testfile1 + update_bundle "$TEST_NAME" test-bundle2 --update /bar/testfile2 + # create new bundles for version 100 + create_bundle -v 100 -n test-bundle3 -f /foo/testfile3 "$TEST_NAME" + create_bundle -v 100 -n test-bundle4 -f /foo/testfile4 "$TEST_NAME" + create_bundle -v 100 -n test-bundle5 -f /foo/testfile5 "$TEST_NAME" + create_bundle -v 100 -n test-bundle6 -f /foo/testfile6 "$TEST_NAME" + create_bundle -v 100 -n test-bundle7 -f /foo/testfile7 "$TEST_NAME" + # add dependencies + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle1 test-bundle3 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle2 test-bundle7 + add_dependency_to_manifest -p "$WEBDIR"/100/Manifest.test-bundle3 test-bundle2 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle3 test-bundle4 + add_dependency_to_manifest -p "$WEBDIR"/100/Manifest.test-bundle4 test-bundle5 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle4 test-bundle6 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle5 test-bundle2 + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle6 os-core + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle7 os-core + + +} + +@test "update with includes" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting test-bundle3 pack for version 100 + Extracting test-bundle4 pack for version 100 + Extracting test-bundle6 pack for version 100 + Extracting test-bundle5 pack for version 100 + Extracting test-bundle2 pack for version 100 + Extracting test-bundle7 pack for version 100 + Extracting test-bundle1 pack for version 100 + Couldn.t use delta file .* no .from. file to apply was found + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 6 + deleted bundles : 0 + changed files : 1 + new files : 13 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + 2 files were not in a pack + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_regex_is_output "$expected_output" + # changed files + assert_file_exists "$TARGETDIR"/foo/testfile1 + assert_file_exists "$TARGETDIR"/bar/testfile2 + # new files + assert_file_exists "$TARGETDIR"/foo/testfile3 + assert_file_exists "$TARGETDIR"/foo/testfile4 + assert_file_exists "$TARGETDIR"/foo/testfile5 + assert_file_exists "$TARGETDIR"/foo/testfile6 + assert_file_exists "$TARGETDIR"/foo/testfile7 + +} diff --git a/test/functional/update/update-missing-os-core.bats b/test/functional/update/update-missing-os-core.bats new file mode 100755 index 00000000..5241dbea --- /dev/null +++ b/test/functional/update/update-missing-os-core.bats @@ -0,0 +1,45 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -n os-core -f /os-core "$TEST_NAME" + create_bundle -L -n test-bundle -f /foo/testfile2 "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --add /testfile1 + update_bundle "$TEST_NAME" test-bundle --update /foo/testfile2 + +} + +@test "update always add os-core to tracked bundles" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Extracting test-bundle pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 2 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 1 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/testfile1 + +} diff --git a/test/functional/update/update-newest-deleted.bats b/test/functional/update/update-newest-deleted.bats new file mode 100755 index 00000000..b4859f7d --- /dev/null +++ b/test/functional/update/update-newest-deleted.bats @@ -0,0 +1,49 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle1 -f /testfile "$TEST_NAME" + create_bundle -L -n test-bundle2 -d /foo "$TEST_NAME" + create_version -p "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" os-core --update /core + update_bundle "$TEST_NAME" test-bundle1 --delete /testfile + update_bundle "$TEST_NAME" test-bundle2 --add /testfile + create_version -p "$TEST_NAME" 30 20 + update_bundle "$TEST_NAME" os-core --update /core + update_bundle "$TEST_NAME" test-bundle2 --delete /testfile + +} + +@test "update where the newest version of a file was deleted" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 30 + Downloading packs... + Statistics for going from version 10 to version 30: + changed bundles : 3 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 1 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + 1 files were not in a pack + Update successful. System updated from version 10 to version 30 + EOM + ) + assert_is_output "$expected_output" + assert_file_not_exists "$TARGETDIR"/testfile + +} + diff --git a/test/functional/update/update-newest-ghosted.bats b/test/functional/update/update-newest-ghosted.bats new file mode 100755 index 00000000..ebbe3658 --- /dev/null +++ b/test/functional/update/update-newest-ghosted.bats @@ -0,0 +1,40 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --ghost /core + +} + +@test "update where the newest version of a file was ghosted" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 0 + deleted files : 1 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-re-update-bad-os-release.bats b/test/functional/update/update-re-update-bad-os-release.bats new file mode 100755 index 00000000..c6a072cc --- /dev/null +++ b/test/functional/update/update-re-update-bad-os-release.bats @@ -0,0 +1,47 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -r "$TEST_NAME" 10 1 + bump_format "$TEST_NAME" + create_version -r "$TEST_NAME" 40 30 2 + # remove the os-release file from all manifests + remove_from_manifest "$WEBDIR"/10/Manifest.os-core /usr/lib/os-release + remove_from_manifest "$WEBDIR"/20/Manifest.os-core /usr/lib/os-release + remove_from_manifest "$WEBDIR"/30/Manifest.os-core /usr/lib/os-release + remove_from_manifest "$WEBDIR"/40/Manifest.os-core /usr/lib/os-release + +} + +@test "update re-update bad os-release" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS_NO_FMT" + assert_status_is 1 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 20 + Downloading packs... + Extracting os-core pack for version 20 + Statistics for going from version 10 to version 20: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 8 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 20 + ERROR: Inconsistency between version files, exiting now. + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-re-update-required.bats b/test/functional/update/update-re-update-required.bats new file mode 100755 index 00000000..a424cf1a --- /dev/null +++ b/test/functional/update/update-re-update-required.bats @@ -0,0 +1,59 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -r "$TEST_NAME" 10 1 + bump_format "$TEST_NAME" + create_version -r "$TEST_NAME" 40 30 2 + +} + +@test "update re-update required" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS_NO_FMT" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 20 + Downloading packs... + Extracting os-core pack for version 20 + Statistics for going from version 10 to version 20: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 9 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 20 + Update started. + Preparing to update from 30 to 40 + Downloading packs... + Extracting os-core pack for version 40 + Statistics for going from version 30 to version 40: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 2 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 30 to version 40 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-rename-ghosted.bats b/test/functional/update/update-rename-ghosted.bats new file mode 100755 index 00000000..9d48cb1a --- /dev/null +++ b/test/functional/update/update-rename-ghosted.bats @@ -0,0 +1,51 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /foo/test-file1,/bar/test-file2,/test-file3 "$TEST_NAME" + create_version "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" test-bundle --rename-legacy /foo/test-file1 /foo/test-file1-renamed + update_bundle "$TEST_NAME" test-bundle --rename-legacy /bar/test-file2 /bar/test-file2-renamed + update_bundle "$TEST_NAME" test-bundle --update /test-file3 + update_manifest "$WEBDIR"/20/Manifest.test-bundle file-status /foo/test-file1 .g.r + update_manifest "$WEBDIR"/20/Manifest.test-bundle file-status /bar/test-file2 .g.r + +} + +@test "update rename ghosted file" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 20 + Downloading packs... + Extracting test-bundle pack for version 20 + Statistics for going from version 10 to version 20: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 2 + deleted files : 2 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 20 + EOM + ) + assert_is_output "$expected_output" + # all the files should still exist, including the ghosted ones + assert_file_exists "$TARGETDIR"/foo/test-file1 + assert_file_exists "$TARGETDIR"/foo/test-file1-renamed + assert_file_exists "$TARGETDIR"/bar/test-file2 + assert_file_exists "$TARGETDIR"/bar/test-file2-renamed + +} + diff --git a/test/functional/update/update-rename.bats b/test/functional/update/update-rename.bats new file mode 100755 index 00000000..9bf51cea --- /dev/null +++ b/test/functional/update/update-rename.bats @@ -0,0 +1,43 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /foo/testfile1,/foo/testfile3 "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle --rename /foo/testfile3 /foo/testfile2 + +} + +@test "update simple rename" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting test-bundle pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 1 + deleted files : 1 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/foo/testfile2 + assert_file_not_exists "$TARGETDIR"/foo/testfile3 + +} diff --git a/test/functional/update/update-skip-scripts.bats b/test/functional/update/update-skip-scripts.bats new file mode 100755 index 00000000..ba5d7f50 --- /dev/null +++ b/test/functional/update/update-skip-scripts.bats @@ -0,0 +1,43 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --update /core + update_bundle "$TEST_NAME" os-core --add /testfile + +} + +@test "update skip post-update scripts" { + + run sudo sh -c "$SWUPD update --no-scripts $SWUPD_OPTS" + # Should still be successful + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 1 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + WARNING: post-update helper scripts skipped due to --no-scripts argument + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + # The file should still be added + assert_file_exists "$TARGETDIR"/testfile +} diff --git a/test/functional/update/update-skip-verified-fullfiles.bats b/test/functional/update/update-skip-verified-fullfiles.bats new file mode 100755 index 00000000..0cf0b9e9 --- /dev/null +++ b/test/functional/update/update-skip-verified-fullfiles.bats @@ -0,0 +1,48 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /foo "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + filehash=$(get_hash_from_manifest "$WEBDIR"/10/Manifest.test-bundle /foo) + update_bundle "$TEST_NAME" test-bundle --update /foo + # restore the hash for /foo in the manifest to the original one so it no longer matches + manifest="$WEBDIR"/100/Manifest.test-bundle + update_manifest "$manifest" file-hash /foo "$filehash" + # to make sure they are not used, remove packs and fullfiles + sudo rm "$WEBDIR"/100/pack-test-bundle-from-0.tar + sudo rm "$WEBDIR"/100/pack-test-bundle-from-10.tar + sudo rm "$WEBDIR"/100/delta/* + sudo rm -rf "$WEBDIR"/100/files/* + +} + +@test "update fullfile download skipped when hash verifies correctly" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/foo + +} diff --git a/test/functional/update/update-slow-server.bats b/test/functional/update/update-slow-server.bats new file mode 100755 index 00000000..8dfa0ee9 --- /dev/null +++ b/test/functional/update/update-slow-server.bats @@ -0,0 +1,101 @@ +#!/usr/bin/env bats + +load "../testlib" + +server_pid="" +port="" +THEME_DIRNAME="$FUNC_DIR/update" + +test_setup() { + + # Skip this test if not running in Travis CI, because test takes too long for + # local development. To run this locally do: TRAVIS=true make check + if [ -z "${TRAVIS}" ]; then + skip "Skipping slow test for local development, test only runs in CI" + fi + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /foo/bar "$TEST_NAME" + create_version -p "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle --update /foo/bar + +} + +test_teardown() { + + # teardown only if in travis CI + if [ -n "${TRAVIS}" ]; then + print "terminating web server (PID: $server_pid)..." + kill "$server_pid" >&3 + print "server killed" + destroy_test_environment "$TEST_NAME" + fi + +} + +@test "update --download with a slow server" { + + # Pre-req: create a web server that can serve as a slow content download server + print "starting web server..." + start_web_server + slow_opts="-u http://localhost:$port/" + + run sudo sh -c "$SWUPD update $slow_opts $SWUPD_OPTS" + + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Error for .*update-slow-server/state/pack-test-bundle-from-10-to-100.tar download: Response 206 - No error + Starting download retry #1 for .*100/pack-test-bundle-from-10.tar + Error for .*update-slow-server/state/pack-test-bundle-from-10-to-100.tar download: Response 200 - Requested range was not delivered by the server + Range command not supported by server, download resume disabled. + Starting download retry #2 for .*100/pack-test-bundle-from-10.tar + Extracting test-bundle pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/foo/bar + +} + +start_web_server() { + + for i in {8081..8181}; do + "$THEME_DIRNAME"/update_slow_server.py $i & + sleep .5 + server_pid=$! + if [ -d /proc/$server_pid ]; then + port=$i + break + fi + done + + # wait until server becomes available by expecting a successful curl + for i in $(seq 1 10); do + flag=true + curl http://localhost:"$port"/ || flag=false + if [ "$flag" == false ]; then + sleep .5 + continue + else + print "server up" + break + fi + done + +} diff --git a/test/functional/update/update-statedir-bad-hash.bats b/test/functional/update/update-statedir-bad-hash.bats new file mode 100755 index 00000000..9ae9af68 --- /dev/null +++ b/test/functional/update/update-statedir-bad-hash.bats @@ -0,0 +1,47 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --add /test-file + file_hash=$(get_hash_from_manifest "$TEST_NAME"/web-dir/100/Manifest.os-core /test-file) + # copy the file from the files directory to state/staged and modify it + sudo cp "$WEBDIR"/100/files/"$file_hash" "$STATEDIR"/staged/ + write_to_protected_file -a "$STATEDIR"/staged/"$file_hash" "extra string" + +} + +@test "update full file with bad hash in state dir" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 0 + new files : 1 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + # no errors are printed for a mismatched hash + assert_is_output "$expected_output" + # the file exists on the filesystem (it does not exist before the test) + assert_file_exists "$TARGETDIR"/test-file + +} diff --git a/test/functional/update/update-status-no-server-content.bats b/test/functional/update/update-status-no-server-content.bats new file mode 100755 index 00000000..8a950241 --- /dev/null +++ b/test/functional/update/update-status-no-server-content.bats @@ -0,0 +1,23 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + sudo rm -rf "$WEBDIR"/version + +} + +@test "update --status with no server content" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" + assert_status_is 2 + expected_output=$(cat <<-EOM + Current OS version: 10 + Cannot get the latest server version. Could not reach server + EOM + ) + assert_is_output "$expected_output" +} + diff --git a/test/functional/update/update-status-no-target-content.bats b/test/functional/update/update-status-no-target-content.bats new file mode 100755 index 00000000..6803c1b1 --- /dev/null +++ b/test/functional/update/update-status-no-target-content.bats @@ -0,0 +1,24 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + set_latest_version "$TEST_NAME" 100 + sudo rm -f "$TARGETDIR"/usr/lib/os-release + +} + +@test "update --status with no target content" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" + assert_status_is 2 + expected_output=$(cat <<-EOM + Cannot determine current OS version + Latest server version: 100 + EOM + ) + assert_is_output "$expected_output" + +} diff --git a/test/functional/update/update-status-version-double-quote.bats b/test/functional/update/update-status-version-double-quote.bats new file mode 100755 index 00000000..b95a66c5 --- /dev/null +++ b/test/functional/update/update-status-version-double-quote.bats @@ -0,0 +1,24 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + set_current_version "$TEST_NAME" "\"10\"" + set_latest_version "$TEST_NAME" 100 + +} + +@test "update --status with double quote version" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" + assert_status_is 0 + expected_output=$(cat <<-EOM + Current OS version: 10 + Latest server version: 100 + EOM + ) + assert_is_output "$expected_output" + +} diff --git a/test/functional/update/update-status-version-single-quote.bats b/test/functional/update/update-status-version-single-quote.bats new file mode 100755 index 00000000..39598fe5 --- /dev/null +++ b/test/functional/update/update-status-version-single-quote.bats @@ -0,0 +1,24 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + set_current_version "$TEST_NAME" "\'10\'" + set_latest_version "$TEST_NAME" 100 + +} + +@test "update --status with single quote version" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" + assert_status_is 0 + expected_output=$(cat <<-EOM + Current OS version: 10 + Latest server version: 100 + EOM + ) + assert_status_is "$expected_output" + +} diff --git a/test/functional/update/update-status.bats b/test/functional/update/update-status.bats new file mode 100755 index 00000000..3e0b5c85 --- /dev/null +++ b/test/functional/update/update-status.bats @@ -0,0 +1,23 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + set_latest_version "$TEST_NAME" 100 + +} + +@test "update --status" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS --status" + assert_status_is 0 + expected_output=$(cat <<-EOM + Current OS version: 10 + Latest server version: 100 + EOM + ) + assert_is_output "$expected_output" + +} diff --git a/test/functional/update/update-use-full-file.bats b/test/functional/update/update-use-full-file.bats new file mode 100755 index 00000000..69c2881d --- /dev/null +++ b/test/functional/update/update-use-full-file.bats @@ -0,0 +1,44 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --update /core + # remove packs so full file is used + sudo rm -rf "$WEBDIR"/100/pack-* + sudo rm -f "$WEBDIR"/100/delta/* + +} + +@test "update use full file" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + 1 files were not in a pack + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-use-pack.bats b/test/functional/update/update-use-pack.bats new file mode 100755 index 00000000..53d7e5bb --- /dev/null +++ b/test/functional/update/update-use-pack.bats @@ -0,0 +1,41 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --update /core + +} + +@test "update using a pack" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting os-core pack for version 100 + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Applying update + Update was applied. + Calling post-update helper scripts. + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/update-verify-fix-path-hash-mismatch.bats b/test/functional/update/update-verify-fix-path-hash-mismatch.bats new file mode 100755 index 00000000..d791f991 --- /dev/null +++ b/test/functional/update/update-verify-fix-path-hash-mismatch.bats @@ -0,0 +1,53 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/foo/test-file "$TEST_NAME" + # remove the installed foo directory + sudo rm -rf "$TARGETDIR"/usr/foo + # change permissions of the installed usr directory so the hash doesn't match + sudo chmod g+w "$TARGETDIR"/usr + # create an update + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle --update /usr/foo/test-file + +} + +@test "update verify_fix_path corrects hash mismatch" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting test-bundle pack for version 100 + Couldn.t use delta file .* + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Update target directory does not exist: .*/target-dir/usr/foo. Trying to fix it + Hash did not match for path : /usr ... fixing + Path /usr/foo is missing on the file system ... fixing + Applying update + Update was applied. + Calling post-update helper scripts. + 1 files were not in a pack + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_exists "$TARGETDIR"/usr/foo + assert_file_exists "$TARGETDIR"/usr/foo/test-file + +} diff --git a/test/functional/update/update-verify-fix-path-missing-dir.bats b/test/functional/update/update-verify-fix-path-missing-dir.bats new file mode 100755 index 00000000..8be05452 --- /dev/null +++ b/test/functional/update/update-verify-fix-path-missing-dir.bats @@ -0,0 +1,50 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/foo/test-file "$TEST_NAME" + # remove the foo dir + sudo rm -rf "$TARGETDIR"/usr/foo + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle --update /usr/foo/test-file + +} + +@test "update verify_fix_path corrects missing directory" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Extracting test-bundle pack for version 100 + Couldn.t use delta file .* + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Staging file content + Update target directory does not exist: .*/target-dir/usr/foo. Trying to fix it + Path /usr/foo is missing on the file system ... fixing + Applying update + Update was applied. + Calling post-update helper scripts. + 1 files were not in a pack + Update successful. System updated from version 10 to version 100 + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_exists "$TARGETDIR"/usr/foo + assert_file_exists "$TARGETDIR"/usr/foo/test-file + +} + diff --git a/test/functional/update/update-verify-fullfile-hash.bats b/test/functional/update/update-verify-fullfile-hash.bats new file mode 100755 index 00000000..b13e1617 --- /dev/null +++ b/test/functional/update/update-verify-fullfile-hash.bats @@ -0,0 +1,45 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" os-core --update /core + file_hash=$(get_hash_from_manifest "$WEBDIR"/100/Manifest.os-core /core) + # remove the /usr/bin/core file from the system + sudo rm -f "$TARGETDIR"/core + # remove packs so fullfiles are used + sudo rm -rf "$WEBDIR"/100/pack-* + # modify the fullfile so it is corrupt + write_to_protected_file -a "$WEBDIR"/100/files/"$file_hash" "some extra stuff to break the hash" + sudo rm "$WEBDIR"/100/files/"$file_hash".tar + create_tar "$WEBDIR"/100/files/"$file_hash" + +} + +@test "update fullfile hashes verified" { + + run sudo sh -c "$SWUPD update $SWUPD_OPTS" + assert_status_is 1 + expected_output=$(cat <<-EOM + Update started. + Preparing to update from 10 to 100 + Downloading packs... + Statistics for going from version 10 to version 100: + changed bundles : 1 + new bundles : 0 + deleted bundles : 0 + changed files : 1 + new files : 0 + deleted files : 0 + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Error: File content hash mismatch for .* \(bad server data\?\) + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_not_exists "$TARGETDIR"/core + +} diff --git a/test/functional/update/slow-server/server.py b/test/functional/update/update_slow_server.py similarity index 87% rename from test/functional/update/slow-server/server.py rename to test/functional/update/update_slow_server.py index 405142d1..a9c5579d 100755 --- a/test/functional/update/slow-server/server.py +++ b/test/functional/update/update_slow_server.py @@ -10,7 +10,7 @@ class SlowResponse(server.BaseHTTPRequestHandler): """Handler that returns data with a set delay between writes""" def do_GET(self): try: - f = open('web-dir/' + self.path, 'rb') + f = open('update-slow-server/web-dir/' + self.path, 'rb') except: self.send_response(404) self.end_headers() @@ -18,7 +18,7 @@ class SlowResponse(server.BaseHTTPRequestHandler): #Simulate partial download partial_download = False - if self.path == "//100/pack-os-core-from-10.tar" and SlowResponse.first_time: + if self.path == "//100/pack-test-bundle-from-10.tar" and SlowResponse.first_time: partial_download = True SlowResponse.first_time = False self.send_response(206) diff --git a/test/functional/update/use-full-file/lines-checked b/test/functional/update/use-full-file/lines-checked deleted file mode 100644 index 95129d6b..00000000 --- a/test/functional/update/use-full-file/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/use-full-file/target-dir/usr/lib/os-release b/test/functional/update/use-full-file/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/use-full-file/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/use-full-file/test.bats b/test/functional/update/use-full-file/test.bats deleted file mode 100755 index 26d9f1c5..00000000 --- a/test/functional/update/use-full-file/test.bats +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_fullfile_tar 100 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "update use full file" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/use-full-file/web-dir/10/Manifest.MoM b/test/functional/update/use-full-file/web-dir/10/Manifest.MoM deleted file mode 100644 index 5f3034d9..00000000 --- a/test/functional/update/use-full-file/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 624af832ff42f0b0592817db4b1bff9672d791592961605cf6e8dc8f5badf4e0 10 os-core diff --git a/test/functional/update/use-full-file/web-dir/10/Manifest.os-core b/test/functional/update/use-full-file/web-dir/10/Manifest.os-core deleted file mode 100644 index dfb192ab..00000000 --- a/test/functional/update/use-full-file/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin diff --git a/test/functional/update/use-full-file/web-dir/100/Manifest.MoM b/test/functional/update/use-full-file/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/update/use-full-file/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/update/use-full-file/web-dir/100/Manifest.os-core b/test/functional/update/use-full-file/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/use-full-file/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/use-full-file/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/use-full-file/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/use-full-file/web-dir/100/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/use-full-file/web-dir/version/formatstaging/latest b/test/functional/update/use-full-file/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/use-full-file/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/use-pack/lines-checked b/test/functional/update/use-pack/lines-checked deleted file mode 100644 index 46230ee0..00000000 --- a/test/functional/update/use-pack/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Extracting os-core pack for version 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -Applying update -Update was applied. -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/use-pack/target-dir/usr/lib/os-release b/test/functional/update/use-pack/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/use-pack/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/use-pack/test.bats b/test/functional/update/use-pack/test.bats deleted file mode 100755 index 73f7dd0f..00000000 --- a/test/functional/update/use-pack/test.bats +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - # create_pack_tar 10 100 os-core $targetfile - chown_root "$DIR/web-dir/100/staged/$targetfile" - tar -C "$DIR/web-dir/100" -cf "$DIR/web-dir/100/pack-os-core-from-10.tar" --exclude=staged/$targetfile/* staged/$targetfile -} - -teardown() { - clean_tars 10 - clean_tars 100 - revert_chown_root "$DIR/web-dir/100/staged/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin" -} - -@test "update using a pack" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/use-pack/web-dir/10/Manifest.MoM b/test/functional/update/use-pack/web-dir/10/Manifest.MoM deleted file mode 100644 index 5f3034d9..00000000 --- a/test/functional/update/use-pack/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 624af832ff42f0b0592817db4b1bff9672d791592961605cf6e8dc8f5badf4e0 10 os-core diff --git a/test/functional/update/use-pack/web-dir/10/Manifest.os-core b/test/functional/update/use-pack/web-dir/10/Manifest.os-core deleted file mode 100644 index dfb192ab..00000000 --- a/test/functional/update/use-pack/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 11251b2c86785c8f5a9328b372e42f9356bd6d1dd2ef4dcf431b8999b31c2e26 10 /usr/bin diff --git a/test/functional/update/use-pack/web-dir/100/Manifest.MoM b/test/functional/update/use-pack/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/update/use-pack/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/update/use-pack/web-dir/100/Manifest.os-core b/test/functional/update/use-pack/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/update/use-pack/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/update/use-pack/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/use-pack/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/use-pack/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/use-pack/web-dir/version/formatstaging/latest b/test/functional/update/use-pack/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/use-pack/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/verify-fix-path-hash-mismatch/lines-checked b/test/functional/update/verify-fix-path-hash-mismatch/lines-checked deleted file mode 100644 index 39fbd89d..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/lines-checked +++ /dev/null @@ -1,19 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -REGEXP:^Update target directory does not exist: .*/target-dir/usr/bin. Trying to fix it$ -Hash did not match for path : /usr ... fixing -Path /usr/bin is missing on the file system ... fixing -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/lib/os-release b/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/share/clear/bundles/test-bundle b/test/functional/update/verify-fix-path-hash-mismatch/target-dir/usr/share/clear/bundles/test-bundle deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fix-path-hash-mismatch/test.bats b/test/functional/update/verify-fix-path-hash-mismatch/test.bats deleted file mode 100755 index 6682b2a7..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/test.bats +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e -f2=520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 test-bundle - create_fullfile_tar 10 $f1 - create_fullfile_tar 100 $f2 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 10 files - clean_tars 100 files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/100/files/$f2" - revert_chown_root "$DIR/target-dir/usr" - sudo rm "$DIR/target-dir/usr/bin/foo" - sudo rmdir "$DIR/target-dir/usr/bin" -} - -@test "update verify_fix_path corrects hash mismatch" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] - [ -f "$DIR/target-dir/usr/bin/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.MoM b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.MoM deleted file mode 100644 index d229f5df..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 94ffb3abc2ea498ab1d1d340535658d5adc46adedfa545a6ae8c94d4e68042e3 10 os-core -M... f9ffe32682a49972d33d0d2df9dd377cc6ba6413af876b2280d946ee5a5e50e8 10 test-bundle diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.os-core b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.os-core deleted file mode 100644 index c8d66a2f..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.test-bundle b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.test-bundle deleted file mode 100644 index 1847abd3..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/Manifest.test-bundle +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin -F... ddff5e545287e632581b82e371de5d4aac2c7eb50d7f357f3b66fb0fdca71dd9 10 /usr/bin/foo diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.MoM b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.MoM deleted file mode 100644 index d93282bf..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 94ffb3abc2ea498ab1d1d340535658d5adc46adedfa545a6ae8c94d4e68042e3 10 os-core -M... c18a84af84a01d15470bc2afb85d546d7f500685a224749d3fa787e25ccc338e 100 test-bundle diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.test-bundle b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.test-bundle deleted file mode 100644 index d3d99692..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/Manifest.test-bundle +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin -F... 520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 100 /usr/bin/foo diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 deleted file mode 100644 index 9f4b6d8b..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 +++ /dev/null @@ -1 +0,0 @@ -This is a test file diff --git a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/version/formatstaging/latest b/test/functional/update/verify-fix-path-hash-mismatch/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/verify-fix-path-hash-mismatch/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/verify-fix-path-missing-dir/lines-checked b/test/functional/update/verify-fix-path-missing-dir/lines-checked deleted file mode 100644 index 1758bdc7..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/lines-checked +++ /dev/null @@ -1,18 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Staging file content -REGEXP:^Update target directory does not exist: .*/target-dir/usr/bin. Trying to fix it$ -Path /usr/bin is missing on the file system ... fixing -Applying update -Update was applied. -1 files were not in a pack -Update successful. System updated from version 10 to version 100 diff --git a/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/lib/os-release b/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/share/clear/bundles/test-bundle b/test/functional/update/verify-fix-path-missing-dir/target-dir/usr/share/clear/bundles/test-bundle deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fix-path-missing-dir/test.bats b/test/functional/update/verify-fix-path-missing-dir/test.bats deleted file mode 100755 index babfcb06..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/test.bats +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e -f2=520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 test-bundle - - chown_root "$DIR/target-dir/usr" - sudo chmod 755 "$DIR/target-dir/usr" - - create_fullfile_tar 10 $f1 - create_fullfile_tar 100 $f2 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 10 files - clean_tars 100 files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/100/files/$f2" - revert_chown_root "$DIR/target-dir/usr" - sudo rm "$DIR/target-dir/usr/bin/foo" - sudo rmdir "$DIR/target-dir/usr/bin" -} - -@test "update verify_fix_path corrects missing directory" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 0 ] - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] - [ -f "$DIR/target-dir/usr/bin/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.MoM b/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.MoM deleted file mode 100644 index d229f5df..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 94ffb3abc2ea498ab1d1d340535658d5adc46adedfa545a6ae8c94d4e68042e3 10 os-core -M... f9ffe32682a49972d33d0d2df9dd377cc6ba6413af876b2280d946ee5a5e50e8 10 test-bundle diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.os-core b/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.os-core deleted file mode 100644 index c8d66a2f..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.test-bundle b/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.test-bundle deleted file mode 100644 index 1847abd3..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/Manifest.test-bundle +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin -F... ddff5e545287e632581b82e371de5d4aac2c7eb50d7f357f3b66fb0fdca71dd9 10 /usr/bin/foo diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/update/verify-fix-path-missing-dir/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.MoM b/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.MoM deleted file mode 100644 index d93282bf..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 94ffb3abc2ea498ab1d1d340535658d5adc46adedfa545a6ae8c94d4e68042e3 10 os-core -M... c18a84af84a01d15470bc2afb85d546d7f500685a224749d3fa787e25ccc338e 100 test-bundle diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.test-bundle b/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.test-bundle deleted file mode 100644 index d3d99692..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/Manifest.test-bundle +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin -F... 520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 100 /usr/bin/foo diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 b/test/functional/update/verify-fix-path-missing-dir/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 deleted file mode 100644 index 9f4b6d8b..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 +++ /dev/null @@ -1 +0,0 @@ -This is a test file diff --git a/test/functional/update/verify-fix-path-missing-dir/web-dir/version/formatstaging/latest b/test/functional/update/verify-fix-path-missing-dir/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/verify-fix-path-missing-dir/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/update/verify-fullfile-hash/lines-checked b/test/functional/update/verify-fullfile-hash/lines-checked deleted file mode 100644 index 438b9b94..00000000 --- a/test/functional/update/verify-fullfile-hash/lines-checked +++ /dev/null @@ -1,12 +0,0 @@ -Update started. -Preparing to update from 10 to 100 -Statistics for going from version 10 to version 100: - changed bundles : 1 - new bundles : 0 - deleted bundles : 0 - changed files : 1 - new files : 0 - deleted files : 0 -Starting download of remaining update content. This may take a while... -Finishing download of update content... -REGEXP:Error: File content hash mismatch for .*/staged/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 \(bad server data\?\) diff --git a/test/functional/update/verify-fullfile-hash/target-dir/usr/lib/os-release b/test/functional/update/verify-fullfile-hash/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/update/verify-fullfile-hash/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/update/verify-fullfile-hash/target-dir/usr/share/clear/bundles/os-core b/test/functional/update/verify-fullfile-hash/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fullfile-hash/target-dir/usr/share/clear/bundles/test-bundle b/test/functional/update/verify-fullfile-hash/target-dir/usr/share/clear/bundles/test-bundle deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/update/verify-fullfile-hash/test.bats b/test/functional/update/verify-fullfile-hash/test.bats deleted file mode 100755 index c82ecbb4..00000000 --- a/test/functional/update/verify-fullfile-hash/test.bats +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 test-bundle - create_fullfile_tar 100 $f1 -} - -teardown() { - clean_tars 10 - clean_tars 100 - clean_tars 100 files - revert_chown_root "$DIR/web-dir/100/files/$f1" -} - -@test "update fullfile hashes verified" { - run sudo sh -c "$SWUPD update $SWUPD_OPTS" - - [ "$status" -eq 1 ] - check_lines "$output" - - [ ! -f "$DIR/target-dir/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.MoM b/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.MoM deleted file mode 100644 index 08470c44..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 1d951049819a561cafa046f5350511d6a132f0e821c342ebe23908911888d01f 10 os-core -M... 2730b7c921c6bf891f47c3f46a4b410ee15f7f864151e436c137723a357875ba 10 test-bundle diff --git a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.os-core b/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.os-core deleted file mode 100644 index 410ebbfc..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... cde33514c151abb2b01448be290ab1d5212952571d15e3533cadc15ff82f2cd5 10 /usr diff --git a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.test-bundle b/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.test-bundle deleted file mode 100644 index ab8cf3c6..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/10/Manifest.test-bundle +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... ddff5e545287e632581b82e371de5d4aac2c7eb50d7f357f3b66fb0fdca71dd9 10 /foo diff --git a/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.MoM b/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.MoM deleted file mode 100644 index ed3aaa52..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451940175 -contentsize: 0 - -M... 1d951049819a561cafa046f5350511d6a132f0e821c342ebe23908911888d01f 10 os-core -M... fb3b6bc74f3813f031deae78679dbde15a81b4b755a8dc247e6ad13da6968689 100 test-bundle diff --git a/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.test-bundle b/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.test-bundle deleted file mode 100644 index e40ee9aa..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/100/Manifest.test-bundle +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 0 -filecount: 2 -timestamp: 1451936779 -contentsize: 17929151 - -F... 520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 100 /foo diff --git a/test/functional/update/verify-fullfile-hash/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 b/test/functional/update/verify-fullfile-hash/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 deleted file mode 100644 index 257cc564..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/100/files/520f83440d3dddc25ad09ca858b9c669245f82d3181a45cdfe793aac9dd1fb15 +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/test/functional/update/verify-fullfile-hash/web-dir/version/formatstaging/latest b/test/functional/update/verify-fullfile-hash/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/update/verify-fullfile-hash/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/verify/add-missing-directory/lines-checked b/test/functional/verify/add-missing-directory/lines-checked deleted file mode 100644 index 3c8f0678..00000000 --- a/test/functional/verify/add-missing-directory/lines-checked +++ /dev/null @@ -1,14 +0,0 @@ -Verifying version 10 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -REGEXP:^Missing file: .*/target-dir/usr/bin$ - fixed -Fixing modified files -Inspected 1 files - 1 files were missing - 1 of 1 missing files were replaced - 0 of 1 missing files were not replaced - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/add-missing-directory/target-dir/usr/lib/os-release b/test/functional/verify/add-missing-directory/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/add-missing-directory/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/add-missing-directory/test.bats b/test/functional/verify/add-missing-directory/test.bats deleted file mode 100755 index b750d68e..00000000 --- a/test/functional/verify/add-missing-directory/test.bats +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_fullfile_tar 10 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify add missing directory" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/add-missing-directory/web-dir/10/Manifest.MoM b/test/functional/verify/add-missing-directory/web-dir/10/Manifest.MoM deleted file mode 100644 index 2800a174..00000000 --- a/test/functional/verify/add-missing-directory/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 1bf200ad0db7009656842c8b1751be4b6b4e3956d7a53065d45e289356792cb1 10 os-core diff --git a/test/functional/verify/add-missing-directory/web-dir/10/Manifest.os-core b/test/functional/verify/add-missing-directory/web-dir/10/Manifest.os-core deleted file mode 100644 index 7179a140..00000000 --- a/test/functional/verify/add-missing-directory/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/verify/add-missing-directory/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/add-missing-directory/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/add-missing-directory/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/add-missing-directory/web-dir/version/formatstaging/latest b/test/functional/verify/add-missing-directory/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/add-missing-directory/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/add-missing-include-old/lines-checked b/test/functional/verify/add-missing-include-old/lines-checked deleted file mode 100644 index 03934f8c..00000000 --- a/test/functional/verify/add-missing-include-old/lines-checked +++ /dev/null @@ -1,18 +0,0 @@ -Verifying version 100 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -REGEXP:^Missing file: .*/target-dir/os-core$ - fixed -REGEXP:^Missing file: .*/target-dir/test-bundle1$ - fixed -REGEXP:^Missing file: .*/target-dir/test-bundle2$ - fixed -Fixing modified files -Inspected 3 files - 3 files were missing - 3 of 3 missing files were replaced - 0 of 3 missing files were not replaced - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/add-missing-include-old/target-dir/usr/lib/os-release b/test/functional/verify/add-missing-include-old/target-dir/usr/lib/os-release deleted file mode 100644 index e65580ca..00000000 --- a/test/functional/verify/add-missing-include-old/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=100 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/add-missing-include-old/target-dir/usr/share/clear/bundles/os-core b/test/functional/verify/add-missing-include-old/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/add-missing-include-old/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/verify/add-missing-include-old/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/add-missing-include-old/test.bats b/test/functional/verify/add-missing-include-old/test.bats deleted file mode 100755 index f8b9cb1b..00000000 --- a/test/functional/verify/add-missing-include-old/test.bats +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 -f2=826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 -f3=a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 10 test-bundle2 - create_fullfile_tar 10 $f1 - - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - create_manifest_tar 100 test-bundle1 - create_fullfile_tar 100 $f2 - create_fullfile_tar 100 $f3 -} - -teardown() { - clean_tars 10 - clean_tars 10 files - clean_tars 100 - clean_tars files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/100/files/$f2" - revert_chown_root "$DIR/web-dir/100/files/$f3" - sudo rm "$DIR/target-dir/os-core" - sudo rm "$DIR/target-dir/test-bundle1" - sudo rm "$DIR/target-dir/test-bundle2" -} - -@test "verify add missing old include" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ -f "$DIR/target-dir/os-core" ] - [ -f "$DIR/target-dir/test-bundle1" ] - [ -f "$DIR/target-dir/test-bundle2" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.MoM b/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.MoM deleted file mode 100644 index 89d019b5..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 580f053aa17496cf73a8d579efd4f9fe3af5648b955c2543ec29b88ea467b8ef 10 os-core -M... 98280dd551d2240379a523538b7eb774c72e9685085f77f2ed51b1d966ef172c 10 test-bundle1 -M... 7850d639166a2a7e166b1150448b80f39296c811c9a899e2823433e094322deb 10 test-bundle2 diff --git a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.os-core b/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.os-core deleted file mode 100644 index 99ba6914..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... dead4952523cf67d92b9f4f03057ca1bf6e1ff018104f7f7ad27d5d4fb38b9ad 10 /os-core diff --git a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle1 b/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index 614d8d8d..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... dead955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-bundle1 diff --git a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle2 b/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle2 deleted file mode 100644 index 280b8ad6..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/10/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... 491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 10 /test-bundle2 diff --git a/test/functional/verify/add-missing-include-old/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 b/test/functional/verify/add-missing-include-old/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 deleted file mode 100644 index be15e407..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 +++ /dev/null @@ -1 +0,0 @@ -test-bundle2 diff --git a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.MoM b/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.MoM deleted file mode 100644 index a60984b7..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 88d187e20077ac674ee02a0f2bdc5da780ee2eceb23a341ddeb50e35f9d423f6 100 os-core -M... fd21b17f85529035177e0b97bb97b0466cf3f9f741459ecd46249ad4f2f0dc12 100 test-bundle1 -M... 7850d639166a2a7e166b1150448b80f39296c811c9a899e2823433e094322deb 10 test-bundle2 diff --git a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.os-core b/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.os-core deleted file mode 100644 index 3fc933f0..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 100 /os-core diff --git a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.test-bundle1 b/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.test-bundle1 deleted file mode 100644 index 64f8c2e3..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/100/Manifest.test-bundle1 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle2 - -F... a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 100 /test-bundle1 diff --git a/test/functional/verify/add-missing-include-old/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 b/test/functional/verify/add-missing-include-old/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 deleted file mode 100644 index 34e0b5e6..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/100/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 +++ /dev/null @@ -1 +0,0 @@ -os-core diff --git a/test/functional/verify/add-missing-include-old/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 b/test/functional/verify/add-missing-include-old/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 deleted file mode 100644 index 639db438..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/100/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 +++ /dev/null @@ -1 +0,0 @@ -test-bundle1 diff --git a/test/functional/verify/add-missing-include-old/web-dir/version/formatstaging/latest b/test/functional/verify/add-missing-include-old/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/verify/add-missing-include-old/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/verify/add-missing-include/lines-checked b/test/functional/verify/add-missing-include/lines-checked deleted file mode 100644 index 5a16afb0..00000000 --- a/test/functional/verify/add-missing-include/lines-checked +++ /dev/null @@ -1,18 +0,0 @@ -Verifying version 10 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -REGEXP:^Missing file: .*/target-dir/os-core$ - fixed -REGEXP:^Missing file: .*/target-dir/test-bundle1$ - fixed -REGEXP:^Missing file: .*/target-dir/test-bundle2$ - fixed -Fixing modified files -Inspected 3 files - 3 files were missing - 3 of 3 missing files were replaced - 0 of 3 missing files were not replaced - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/add-missing-include/target-dir/usr/lib/os-release b/test/functional/verify/add-missing-include/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/add-missing-include/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/add-missing-include/target-dir/usr/share/clear/bundles/os-core b/test/functional/verify/add-missing-include/target-dir/usr/share/clear/bundles/os-core deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/add-missing-include/target-dir/usr/share/clear/bundles/test-bundle1 b/test/functional/verify/add-missing-include/target-dir/usr/share/clear/bundles/test-bundle1 deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/add-missing-include/test.bats b/test/functional/verify/add-missing-include/test.bats deleted file mode 100755 index 6f4a5654..00000000 --- a/test/functional/verify/add-missing-include/test.bats +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -f1=491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 -f2=826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 -f3=a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_manifest_tar 10 test-bundle1 - create_manifest_tar 10 test-bundle2 - create_fullfile_tar 10 $f1 - create_fullfile_tar 10 $f2 - create_fullfile_tar 10 $f3 -} - -teardown() { - clean_tars 10 - clean_tars files - revert_chown_root "$DIR/web-dir/10/files/$f1" - revert_chown_root "$DIR/web-dir/10/files/$f2" - revert_chown_root "$DIR/web-dir/10/files/$f3" - sudo rm "$DIR/target-dir/os-core" - sudo rm "$DIR/target-dir/test-bundle1" - sudo rm "$DIR/target-dir/test-bundle2" -} - -@test "verify add missing include" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ -f "$DIR/target-dir/os-core" ] - [ -f "$DIR/target-dir/test-bundle1" ] - [ -f "$DIR/target-dir/test-bundle2" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/add-missing-include/web-dir/10/Manifest.MoM b/test/functional/verify/add-missing-include/web-dir/10/Manifest.MoM deleted file mode 100644 index 022da4da..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... bfabc9318be87606f2aa5a5e65f5b24f5e8442034059bcfbc142e68a6e37c087 10 os-core -M... c81e327a64d514f7559762e3fafc1e7be832f1717563b4c94e218c1c14ec95e7 10 test-bundle1 -M... 7850d639166a2a7e166b1150448b80f39296c811c9a899e2823433e094322deb 10 test-bundle2 diff --git a/test/functional/verify/add-missing-include/web-dir/10/Manifest.os-core b/test/functional/verify/add-missing-include/web-dir/10/Manifest.os-core deleted file mode 100644 index 9d29f5d7..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F... 826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 10 /os-core diff --git a/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle1 b/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle1 deleted file mode 100644 index f82653e7..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle1 +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core -includes: test-bundle2 - -F... a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 10 /test-bundle1 diff --git a/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle2 b/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle2 deleted file mode 100644 index 280b8ad6..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/Manifest.test-bundle2 +++ /dev/null @@ -1,9 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 -includes: os-core - -F... 491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 10 /test-bundle2 diff --git a/test/functional/verify/add-missing-include/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 b/test/functional/verify/add-missing-include/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 deleted file mode 100644 index be15e407..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/files/491685caf9cf95df0f721254748df4717b4159513a3e0170ff5fa404dccc32e7 +++ /dev/null @@ -1 +0,0 @@ -test-bundle2 diff --git a/test/functional/verify/add-missing-include/web-dir/10/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 b/test/functional/verify/add-missing-include/web-dir/10/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 deleted file mode 100644 index 34e0b5e6..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/files/826e0a73bdb6ca4863842b07ead83a55b478a950fefd2b1832b30046ce1c1550 +++ /dev/null @@ -1 +0,0 @@ -os-core diff --git a/test/functional/verify/add-missing-include/web-dir/10/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 b/test/functional/verify/add-missing-include/web-dir/10/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 deleted file mode 100644 index 639db438..00000000 --- a/test/functional/verify/add-missing-include/web-dir/10/files/a96e0b959874854750e8e08372e62c4d1821c5e0106694365396d02c363ada50 +++ /dev/null @@ -1 +0,0 @@ -test-bundle1 diff --git a/test/functional/verify/add-missing-include/web-dir/version/formatstaging/latest b/test/functional/verify/add-missing-include/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/add-missing-include/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/boot-file-deleted/lines-checked b/test/functional/verify/boot-file-deleted/lines-checked deleted file mode 100644 index 2a2339dc..00000000 --- a/test/functional/verify/boot-file-deleted/lines-checked +++ /dev/null @@ -1,8 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -Inspected 0 files - 0 files were missing - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/boot-file-deleted/target-dir/usr/lib/kernel/testfile b/test/functional/verify/boot-file-deleted/target-dir/usr/lib/kernel/testfile deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/boot-file-deleted/target-dir/usr/lib/kernel/testfile +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/boot-file-deleted/target-dir/usr/lib/os-release b/test/functional/verify/boot-file-deleted/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/boot-file-deleted/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/boot-file-deleted/test.bats b/test/functional/verify/boot-file-deleted/test.bats deleted file mode 100755 index 11560fa4..00000000 --- a/test/functional/verify/boot-file-deleted/test.bats +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/target-dir/usr/lib/kernel/testfile" - create_fullfile_tar 10 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/kernel/testfile" - cp "$DIR/web-dir/10/files/$targetfile" "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "verify add missing boot file" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.MoM b/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.MoM deleted file mode 100644 index 56a3851b..00000000 --- a/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 06ded0bcfc48624ccade8ac4ce3ec5fe127d49fe2b0f0152e7c25fd0f0f5d46d 10 os-core diff --git a/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.os-core b/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.os-core deleted file mode 100644 index 7a1fb778..00000000 --- a/test/functional/verify/boot-file-deleted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -.db. 0000000000000000000000000000000000000000000000000000000000000000 10 /usr/lib/kernel/testfile diff --git a/test/functional/verify/boot-file-deleted/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/verify/boot-file-deleted/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/boot-file-deleted/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/boot-file-deleted/web-dir/version/formatstaging/latest b/test/functional/verify/boot-file-deleted/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/boot-file-deleted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/boot-file-mismatch-fix/lines-checked b/test/functional/verify/boot-file-mismatch-fix/lines-checked deleted file mode 100644 index acd1b5f9..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/lines-checked +++ /dev/null @@ -1,15 +0,0 @@ -Verifying version 10 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -Fixing modified files -REGEXP:^Hash mismatch for file: .*/target-dir/usr/lib/kernel/testfile$ - fixed -Inspected 1 files - 0 files were missing - 1 files did not match - 1 of 1 files were fixed - 0 of 1 files were not fixed - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile b/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile deleted file mode 100644 index bcc82759..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile +++ /dev/null @@ -1 +0,0 @@ -**CORRUPT!** test boot file diff --git a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile.backup b/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile.backup deleted file mode 100644 index bcc82759..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/kernel/testfile.backup +++ /dev/null @@ -1 +0,0 @@ -**CORRUPT!** test boot file diff --git a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/os-release b/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/boot-file-mismatch-fix/test.bats b/test/functional/verify/boot-file-mismatch-fix/test.bats deleted file mode 100755 index 73cb225e..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/test.bats +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/target-dir/usr/lib/kernel/testfile" - create_fullfile_tar 10 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/kernel/testfile" - cp "$DIR/target-dir/usr/lib/kernel/testfile.backup" "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "verify fix incorrect boot file" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS --fix" - - check_lines "$output" - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.MoM b/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.MoM deleted file mode 100644 index 6de33559..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 38ce8471091f595220345313378dd75b24cbb553805fb3f5fca9232c15cdcbcd 10 os-core diff --git a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.os-core b/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.os-core deleted file mode 100644 index 0c08ba20..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F.b. e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 10 /usr/lib/kernel/testfile diff --git a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/verify/boot-file-mismatch-fix/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/boot-file-mismatch-fix/web-dir/version/formatstaging/latest b/test/functional/verify/boot-file-mismatch-fix/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/boot-file-mismatch-fix/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/boot-file-mismatch/lines-checked b/test/functional/verify/boot-file-mismatch/lines-checked deleted file mode 100644 index 15b1df25..00000000 --- a/test/functional/verify/boot-file-mismatch/lines-checked +++ /dev/null @@ -1,6 +0,0 @@ -Verifying version 10 -Verifying files -REGEXP:^Hash mismatch for file: .*/target-dir/usr/lib/kernel/testfile$ -Inspected 1 files - 1 files did not match -Verify successful diff --git a/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/kernel/testfile b/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/kernel/testfile deleted file mode 100644 index bcc82759..00000000 --- a/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/kernel/testfile +++ /dev/null @@ -1 +0,0 @@ -**CORRUPT!** test boot file diff --git a/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/os-release b/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/boot-file-mismatch/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/boot-file-mismatch/test.bats b/test/functional/verify/boot-file-mismatch/test.bats deleted file mode 100755 index ff34efa0..00000000 --- a/test/functional/verify/boot-file-mismatch/test.bats +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/target-dir/usr/lib/kernel/testfile" -} - -teardown() { - clean_tars 10 - revert_chown_root "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "verify check incorrect boot file" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS" - - check_lines "$output" - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.MoM b/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.MoM deleted file mode 100644 index 6de33559..00000000 --- a/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 38ce8471091f595220345313378dd75b24cbb553805fb3f5fca9232c15cdcbcd 10 os-core diff --git a/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.os-core b/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.os-core deleted file mode 100644 index 0c08ba20..00000000 --- a/test/functional/verify/boot-file-mismatch/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -F.b. e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 10 /usr/lib/kernel/testfile diff --git a/test/functional/verify/boot-file-mismatch/web-dir/version/formatstaging/latest b/test/functional/verify/boot-file-mismatch/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/boot-file-mismatch/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/boot-skip/lines-checked b/test/functional/verify/boot-skip/lines-checked deleted file mode 100644 index ef25324a..00000000 --- a/test/functional/verify/boot-skip/lines-checked +++ /dev/null @@ -1,9 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -Inspected 0 files - 0 files were missing - 0 files found which should be deleted -WARNING: boot files update skipped due to --no-boot-update argument -Fix successful diff --git a/test/functional/verify/boot-skip/target-dir/usr/lib/kernel/testfile b/test/functional/verify/boot-skip/target-dir/usr/lib/kernel/testfile deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/boot-skip/target-dir/usr/lib/kernel/testfile +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/boot-skip/target-dir/usr/lib/os-release b/test/functional/verify/boot-skip/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/boot-skip/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/boot-skip/test.bats b/test/functional/verify/boot-skip/test.bats deleted file mode 100755 index fc798b3b..00000000 --- a/test/functional/verify/boot-skip/test.bats +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/target-dir/usr/lib/kernel/testfile" - create_fullfile_tar 10 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/kernel/testfile" - cp "$DIR/web-dir/10/files/$targetfile" "$DIR/target-dir/usr/lib/kernel/testfile" -} - -@test "verify override boot update" { - run sudo sh -c "$SWUPD verify --fix -b $SWUPD_OPTS" - - check_lines "$output" - # this should exist at the end, even if cbm is not run - [ -f "$DIR/target-dir/usr/lib/kernel/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/boot-skip/web-dir/10/Manifest.MoM b/test/functional/verify/boot-skip/web-dir/10/Manifest.MoM deleted file mode 100644 index 56a3851b..00000000 --- a/test/functional/verify/boot-skip/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 06ded0bcfc48624ccade8ac4ce3ec5fe127d49fe2b0f0152e7c25fd0f0f5d46d 10 os-core diff --git a/test/functional/verify/boot-skip/web-dir/10/Manifest.os-core b/test/functional/verify/boot-skip/web-dir/10/Manifest.os-core deleted file mode 100644 index 7a1fb778..00000000 --- a/test/functional/verify/boot-skip/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -.db. 0000000000000000000000000000000000000000000000000000000000000000 10 /usr/lib/kernel/testfile diff --git a/test/functional/verify/boot-skip/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/verify/boot-skip/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/boot-skip/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/boot-skip/web-dir/version/formatstaging/latest b/test/functional/verify/boot-skip/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/boot-skip/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/check-missing-directory/lines-checked b/test/functional/verify/check-missing-directory/lines-checked deleted file mode 100644 index 03265b40..00000000 --- a/test/functional/verify/check-missing-directory/lines-checked +++ /dev/null @@ -1,6 +0,0 @@ -Verifying version 10 -Verifying files -REGEXP:^Hash mismatch for file: .*/target-dir/usr/bin$ -Inspected 1 files - 1 files did not match -Verify successful diff --git a/test/functional/verify/check-missing-directory/target-dir/usr/lib/os-release b/test/functional/verify/check-missing-directory/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/check-missing-directory/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/check-missing-directory/test.bats b/test/functional/verify/check-missing-directory/test.bats deleted file mode 100755 index 65e2013f..00000000 --- a/test/functional/verify/check-missing-directory/test.bats +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core -} - -teardown() { - clean_tars 10 -} - -@test "verify check missing directory" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS" - - check_lines "$output" - [ ! -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/check-missing-directory/web-dir/10/Manifest.MoM b/test/functional/verify/check-missing-directory/web-dir/10/Manifest.MoM deleted file mode 100644 index 55b81a4e..00000000 --- a/test/functional/verify/check-missing-directory/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 060ef6ba332910822f942da6b242dcff297ff2dc0f0fb65c28a6ad70539709ba 10 os-core diff --git a/test/functional/verify/check-missing-directory/web-dir/10/Manifest.os-core b/test/functional/verify/check-missing-directory/web-dir/10/Manifest.os-core deleted file mode 100644 index 06f9e7f5..00000000 --- a/test/functional/verify/check-missing-directory/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin diff --git a/test/functional/verify/check-missing-directory/web-dir/version/formatstaging/latest b/test/functional/verify/check-missing-directory/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/check-missing-directory/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/directory-tree-deleted/lines-checked b/test/functional/verify/directory-tree-deleted/lines-checked deleted file mode 100644 index 584a6709..00000000 --- a/test/functional/verify/directory-tree-deleted/lines-checked +++ /dev/null @@ -1,13 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -REGEXP:Deleted .*/target-dir/testdir1/testdir2/testfile -REGEXP:Deleted .*/target-dir/testdir1/testdir2 -REGEXP:Deleted .*/target-dir/testdir1 -Inspected 0 files - 0 files were missing - 3 files found which should be deleted - 3 of 3 files were deleted - 0 of 3 files were not deleted -Fix successful diff --git a/test/functional/verify/directory-tree-deleted/target-dir/testdir1/testdir2/testfile b/test/functional/verify/directory-tree-deleted/target-dir/testdir1/testdir2/testfile deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/directory-tree-deleted/target-dir/usr/lib/os-release b/test/functional/verify/directory-tree-deleted/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/directory-tree-deleted/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/directory-tree-deleted/test.bats b/test/functional/verify/directory-tree-deleted/test.bats deleted file mode 100755 index 80c117b3..00000000 --- a/test/functional/verify/directory-tree-deleted/test.bats +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core -} - -teardown() { - clean_tars 10 - mkdir -p "$DIR/target-dir/testdir1/testdir2" - touch "$DIR/target-dir/testdir1/testdir2/testfile" -} - -@test "verify delete directory tree" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ ! -d "$DIR/target-dir/testdir1" ] - [ ! -d "$DIR/target-dir/testdir1/testdir2" ] - [ ! -f "$DIR/target-dir/testdir1/testdir2/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.MoM b/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.MoM deleted file mode 100644 index e46285ab..00000000 --- a/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... c37aba8f0cae36156d20cd88123bcfb43e3582cbf86eea3900df66d6a5f280c0 10 os-core diff --git a/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.os-core b/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.os-core deleted file mode 100644 index c170b807..00000000 --- a/test/functional/verify/directory-tree-deleted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 3 -timestamp: 1451936779 -contentsize: 17929151 - -.d.. 0000000000000000000000000000000000000000000000000000000000000000 10 /testdir1 -.d.. 0000000000000000000000000000000000000000000000000000000000000000 10 /testdir1/testdir2 -.d.. 0000000000000000000000000000000000000000000000000000000000000000 10 /testdir1/testdir2/testfile diff --git a/test/functional/verify/directory-tree-deleted/web-dir/version/formatstaging/latest b/test/functional/verify/directory-tree-deleted/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/directory-tree-deleted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/empty-dir-deleted/lines-checked b/test/functional/verify/empty-dir-deleted/lines-checked deleted file mode 100644 index 7e823a3f..00000000 --- a/test/functional/verify/empty-dir-deleted/lines-checked +++ /dev/null @@ -1,11 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -REGEXP:^Deleted .*/target-dir/testdir$ -Inspected 0 files - 0 files were missing - 1 files found which should be deleted - 1 of 1 files were deleted - 0 of 1 files were not deleted -Fix successful diff --git a/test/functional/verify/empty-dir-deleted/target-dir/testdir/.gitignore b/test/functional/verify/empty-dir-deleted/target-dir/testdir/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/test/functional/verify/empty-dir-deleted/target-dir/usr/lib/os-release b/test/functional/verify/empty-dir-deleted/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/empty-dir-deleted/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/empty-dir-deleted/test.bats b/test/functional/verify/empty-dir-deleted/test.bats deleted file mode 100755 index c6ae78a4..00000000 --- a/test/functional/verify/empty-dir-deleted/test.bats +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - rm "$DIR/target-dir/testdir/.gitignore" -} - -teardown() { - clean_tars 10 - mkdir -p "$DIR/target-dir/testdir" - touch "$DIR/target-dir/testdir/.gitignore" -} - -@test "verify delete already removed directory" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - check_lines "$output" - [ ! -d "$DIR/target-dir/testdir" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.MoM b/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.MoM deleted file mode 100644 index e1a85270..00000000 --- a/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 35613f9da3a4fbbd875bdb51da54be0230e75a7b5e44d4f4fe1dd8a6b2912195 10 os-core diff --git a/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.os-core b/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.os-core deleted file mode 100644 index 35e09649..00000000 --- a/test/functional/verify/empty-dir-deleted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -.d.. 0000000000000000000000000000000000000000000000000000000000000000 10 /testdir diff --git a/test/functional/verify/empty-dir-deleted/web-dir/version/formatstaging/latest b/test/functional/verify/empty-dir-deleted/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/empty-dir-deleted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/fix-version-mismatch-override/lines-checked b/test/functional/verify/fix-version-mismatch-override/lines-checked deleted file mode 100644 index d1fba477..00000000 --- a/test/functional/verify/fix-version-mismatch-override/lines-checked +++ /dev/null @@ -1,15 +0,0 @@ -Verifying version 10 -WARNING: the force or picky option is specified; ignoring version mismatch for verify --fix -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -REGEXP:^Missing file: .+/target-dir/usr/bin$ - fixed -Fixing modified files -Inspected 1 files - 1 files were missing - 1 of 1 missing files were replaced - 0 of 1 missing files were not replaced - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/fix-version-mismatch-override/target-dir/usr/lib/os-release b/test/functional/verify/fix-version-mismatch-override/target-dir/usr/lib/os-release deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/verify/fix-version-mismatch-override/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/verify/fix-version-mismatch-override/test.bats b/test/functional/verify/fix-version-mismatch-override/test.bats deleted file mode 100755 index db69f069..00000000 --- a/test/functional/verify/fix-version-mismatch-override/test.bats +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_fullfile_tar 10 $targetfile - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - - clean_tars 20 - clean_tars 20 files - - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - revert_chown_root "$DIR/web-dir/20/files/$targetfile" - - # test should succeed and therefore install this dir - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify version mismatch override" { - run sudo sh -c "$SWUPD verify --fix -m 10 --force $SWUPD_OPTS" - - [ $status -eq 0 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.MoM b/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.MoM deleted file mode 100644 index b4249a06..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 15d53310ea1d80c7d0045b76081f5334afb99e53efd81579e07ef869b7ab790e 10 os-core diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.os-core b/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.os-core deleted file mode 100644 index 1043b2a6..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/fix-version-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.MoM b/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.MoM deleted file mode 100644 index 59cd0929..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3ba369029c1bbfd5888d090e107ce0f5cd7ed074143e466c171ca16064532dcc 20 os-core diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.os-core b/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.os-core deleted file mode 100644 index 3e305184..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/fix-version-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/fix-version-mismatch-override/web-dir/version/formatstaging/latest b/test/functional/verify/fix-version-mismatch-override/web-dir/version/formatstaging/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/verify/fix-version-mismatch-override/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/verify/fix-version-mismatch/lines-checked b/test/functional/verify/fix-version-mismatch/lines-checked deleted file mode 100644 index 39044f20..00000000 --- a/test/functional/verify/fix-version-mismatch/lines-checked +++ /dev/null @@ -1,3 +0,0 @@ -Verifying version 10 -ERROR: Fixing to a different version requires --force or --picky -Error: Fix did not fully succeed diff --git a/test/functional/verify/fix-version-mismatch/target-dir/usr/lib/os-release b/test/functional/verify/fix-version-mismatch/target-dir/usr/lib/os-release deleted file mode 100644 index 36f421bf..00000000 --- a/test/functional/verify/fix-version-mismatch/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=20 diff --git a/test/functional/verify/fix-version-mismatch/test.bats b/test/functional/verify/fix-version-mismatch/test.bats deleted file mode 100755 index 269aa4ec..00000000 --- a/test/functional/verify/fix-version-mismatch/test.bats +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - - clean_tars 20 - clean_tars 20 files - - revert_chown_root "$DIR/web-dir/20/files/$targetfile" -} - -@test "verify version mismatch enforcement" { - run sudo sh -c "$SWUPD verify --fix -m 10 $SWUPD_OPTS" - - # 14 = EMANIFEST_LOAD - [ $status -eq 14 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/fix-version-mismatch/web-dir/10/Manifest.MoM b/test/functional/verify/fix-version-mismatch/web-dir/10/Manifest.MoM deleted file mode 100644 index b4249a06..00000000 --- a/test/functional/verify/fix-version-mismatch/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 15d53310ea1d80c7d0045b76081f5334afb99e53efd81579e07ef869b7ab790e 10 os-core diff --git a/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.MoM b/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.MoM deleted file mode 100644 index 59cd0929..00000000 --- a/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3ba369029c1bbfd5888d090e107ce0f5cd7ed074143e466c171ca16064532dcc 20 os-core diff --git a/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.os-core b/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.os-core deleted file mode 100644 index 3e305184..00000000 --- a/test/functional/verify/fix-version-mismatch/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin diff --git a/test/functional/verify/fix-version-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/fix-version-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/fix-version-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/fix-version-mismatch/web-dir/version/formatstaging/latest b/test/functional/verify/fix-version-mismatch/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/fix-version-mismatch/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/format-mismatch-override/lines-checked b/test/functional/verify/format-mismatch-override/lines-checked deleted file mode 100644 index 6ff2e71a..00000000 --- a/test/functional/verify/format-mismatch-override/lines-checked +++ /dev/null @@ -1,16 +0,0 @@ -Verifying version 20 -WARNING: the force option is specified; ignoring format mismatch for verify -WARNING: the force or picky option is specified; ignoring version mismatch for verify --fix -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -REGEXP:^Missing file: .+/target-dir/usr/bin$ - fixed -Fixing modified files -Inspected 1 files - 1 files were missing - 1 of 1 missing files were replaced - 0 of 1 missing files were not replaced - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/format-mismatch-override/target-dir/usr/lib/os-release b/test/functional/verify/format-mismatch-override/target-dir/usr/lib/os-release deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/verify/format-mismatch-override/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/verify/format-mismatch-override/test.bats b/test/functional/verify/format-mismatch-override/test.bats deleted file mode 100755 index 33d2e303..00000000 --- a/test/functional/verify/format-mismatch-override/test.bats +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_fullfile_tar 10 $targetfile - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - - clean_tars 20 - clean_tars 20 files - - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - revert_chown_root "$DIR/web-dir/20/files/$targetfile" - - # test should succeed and therefore install this dir - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify format mismatch override" { - # the -x option bypasses the fatal error - run sudo sh -c "$SWUPD verify --fix -F 1 -m 20 -x $SWUPD_OPTS_NO_FMT" - - [ $status -eq 0 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.MoM b/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.MoM deleted file mode 100644 index b4249a06..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 15d53310ea1d80c7d0045b76081f5334afb99e53efd81579e07ef869b7ab790e 10 os-core diff --git a/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.os-core b/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.os-core deleted file mode 100644 index 1043b2a6..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/verify/format-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/format-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.MoM b/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.MoM deleted file mode 100644 index 59cd0929..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3ba369029c1bbfd5888d090e107ce0f5cd7ed074143e466c171ca16064532dcc 20 os-core diff --git a/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.os-core b/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.os-core deleted file mode 100644 index 3e305184..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin diff --git a/test/functional/verify/format-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/format-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/format-mismatch-override/web-dir/version/format1/latest b/test/functional/verify/format-mismatch-override/web-dir/version/format1/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/version/format1/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/format-mismatch-override/web-dir/version/format2/latest b/test/functional/verify/format-mismatch-override/web-dir/version/format2/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/verify/format-mismatch-override/web-dir/version/format2/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/verify/format-mismatch/lines-checked b/test/functional/verify/format-mismatch/lines-checked deleted file mode 100644 index e654d94d..00000000 --- a/test/functional/verify/format-mismatch/lines-checked +++ /dev/null @@ -1,4 +0,0 @@ -Verifying version 20 -ERROR: Mismatching formats detected when verifying 20 (expected: 1; actual: 2) -Latest supported version to verify: 10 -Error: Fix did not fully succeed diff --git a/test/functional/verify/format-mismatch/target-dir/usr/lib/os-release b/test/functional/verify/format-mismatch/target-dir/usr/lib/os-release deleted file mode 100644 index b01f31ec..00000000 --- a/test/functional/verify/format-mismatch/target-dir/usr/lib/os-release +++ /dev/null @@ -1 +0,0 @@ -VERSION_ID=10 diff --git a/test/functional/verify/format-mismatch/test.bats b/test/functional/verify/format-mismatch/test.bats deleted file mode 100755 index cad5c893..00000000 --- a/test/functional/verify/format-mismatch/test.bats +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - create_fullfile_tar 10 $targetfile - - create_manifest_tar 20 MoM - sign_manifest_mom 20 - create_manifest_tar 20 os-core - create_fullfile_tar 20 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - - clean_tars 20 - clean_tars 20 files - - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - revert_chown_root "$DIR/web-dir/20/files/$targetfile" - - #sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify format mismatch enforcement" { - run sudo sh -c "$SWUPD verify --fix -F 1 -m 20 $SWUPD_OPTS_NO_FMT" - - # 14 = EMANIFEST_LOAD - [ $status -eq 14 ] - check_lines "$output" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/format-mismatch/web-dir/10/Manifest.MoM b/test/functional/verify/format-mismatch/web-dir/10/Manifest.MoM deleted file mode 100644 index b4249a06..00000000 --- a/test/functional/verify/format-mismatch/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 15d53310ea1d80c7d0045b76081f5334afb99e53efd81579e07ef869b7ab790e 10 os-core diff --git a/test/functional/verify/format-mismatch/web-dir/10/Manifest.os-core b/test/functional/verify/format-mismatch/web-dir/10/Manifest.os-core deleted file mode 100644 index 1043b2a6..00000000 --- a/test/functional/verify/format-mismatch/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 1 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/verify/format-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/format-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/format-mismatch/web-dir/10/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/format-mismatch/web-dir/20/Manifest.MoM b/test/functional/verify/format-mismatch/web-dir/20/Manifest.MoM deleted file mode 100644 index 59cd0929..00000000 --- a/test/functional/verify/format-mismatch/web-dir/20/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3ba369029c1bbfd5888d090e107ce0f5cd7ed074143e466c171ca16064532dcc 20 os-core diff --git a/test/functional/verify/format-mismatch/web-dir/20/Manifest.os-core b/test/functional/verify/format-mismatch/web-dir/20/Manifest.os-core deleted file mode 100644 index 3e305184..00000000 --- a/test/functional/verify/format-mismatch/web-dir/20/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 2 -version: 20 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 20 /usr/bin diff --git a/test/functional/verify/format-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/format-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/format-mismatch/web-dir/20/files/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/format-mismatch/web-dir/version/format1/latest b/test/functional/verify/format-mismatch/web-dir/version/format1/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/format-mismatch/web-dir/version/format1/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/format-mismatch/web-dir/version/format2/latest b/test/functional/verify/format-mismatch/web-dir/version/format2/latest deleted file mode 100644 index 209e3ef4..00000000 --- a/test/functional/verify/format-mismatch/web-dir/version/format2/latest +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/test/functional/verify/ghosted/lines-checked b/test/functional/verify/ghosted/lines-checked deleted file mode 100644 index 2a2339dc..00000000 --- a/test/functional/verify/ghosted/lines-checked +++ /dev/null @@ -1,8 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -Inspected 0 files - 0 files were missing - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/ghosted/target-dir.bak/foo b/test/functional/verify/ghosted/target-dir.bak/foo deleted file mode 100644 index 37bfb8c6..00000000 --- a/test/functional/verify/ghosted/target-dir.bak/foo +++ /dev/null @@ -1,5 +0,0 @@ - .-. - (o o) boo! - | O \ - \ \ - `~~~' diff --git a/test/functional/verify/ghosted/target-dir/foo b/test/functional/verify/ghosted/target-dir/foo deleted file mode 100644 index 37bfb8c6..00000000 --- a/test/functional/verify/ghosted/target-dir/foo +++ /dev/null @@ -1,5 +0,0 @@ - .-. - (o o) boo! - | O \ - \ \ - `~~~' diff --git a/test/functional/verify/ghosted/target-dir/usr/lib/os-release b/test/functional/verify/ghosted/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/ghosted/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/ghosted/test.bats b/test/functional/verify/ghosted/test.bats deleted file mode 100755 index b77e7f32..00000000 --- a/test/functional/verify/ghosted/test.bats +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root -R "$DIR/target-dir" -} - -teardown() { - clean_tars 10 - clean_tars 10 files - sudo cp -r "$DIR/target-dir.bak/foo" "$DIR/target-dir" - revert_chown_root -R "$DIR/target-dir" -} - -@test "verify ghosted file skipped" { - run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" - - [ $status -eq 0 ] - check_lines "$output" - # this should exist at the end, despite being marked as "ghosted" in the - # Manifest and treated as deleted for parts of swupd-client. - [ -f "$DIR/target-dir/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/ghosted/web-dir/10/Manifest.MoM b/test/functional/verify/ghosted/web-dir/10/Manifest.MoM deleted file mode 100644 index 01fc7099..00000000 --- a/test/functional/verify/ghosted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 907d96973c42eac1e5f81fad740561ac86ade5e9d342ec05274cbc15f9730760 10 os-core diff --git a/test/functional/verify/ghosted/web-dir/10/Manifest.os-core b/test/functional/verify/ghosted/web-dir/10/Manifest.os-core deleted file mode 100644 index 7413eb80..00000000 --- a/test/functional/verify/ghosted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -.g.. 17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 10 /foo diff --git a/test/functional/verify/ghosted/web-dir/version/formatstaging/latest b/test/functional/verify/ghosted/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/ghosted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/install-directory/lines-checked b/test/functional/verify/install-directory/lines-checked deleted file mode 100644 index ad84508a..00000000 --- a/test/functional/verify/install-directory/lines-checked +++ /dev/null @@ -1,11 +0,0 @@ -Verifying version 10 -Extracting os-core pack for version 10 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -Inspected 1 files - 1 files were missing - 1 of 1 missing files were replaced - 0 of 1 missing files were not replaced -Fix successful diff --git a/test/functional/verify/install-directory/target-dir/usr/lib/os-release b/test/functional/verify/install-directory/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/install-directory/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/install-directory/test.bats b/test/functional/verify/install-directory/test.bats deleted file mode 100755 index 81b8d899..00000000 --- a/test/functional/verify/install-directory/test.bats +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/web-dir/10/staged/$targetfile" - tar -C "$DIR/web-dir/10" -cf "$DIR/web-dir/10/pack-os-core-from-0.tar" --exclude=staged/$targetfile/* staged/$targetfile -} - -teardown() { - clean_tars 10 - revert_chown_root "$DIR/web-dir/10/staged/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify install directory" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m 10" - - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/install-directory/web-dir/10/Manifest.MoM b/test/functional/verify/install-directory/web-dir/10/Manifest.MoM deleted file mode 100644 index 2800a174..00000000 --- a/test/functional/verify/install-directory/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 1bf200ad0db7009656842c8b1751be4b6b4e3956d7a53065d45e289356792cb1 10 os-core diff --git a/test/functional/verify/install-directory/web-dir/10/Manifest.os-core b/test/functional/verify/install-directory/web-dir/10/Manifest.os-core deleted file mode 100644 index 7179a140..00000000 --- a/test/functional/verify/install-directory/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/bin diff --git a/test/functional/verify/install-directory/web-dir/10/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/install-directory/web-dir/10/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/install-directory/web-dir/10/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/install-directory/web-dir/version/formatstaging/latest b/test/functional/verify/install-directory/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/install-directory/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/install-latest-directory/lines-checked b/test/functional/verify/install-latest-directory/lines-checked deleted file mode 100644 index 6010a2fb..00000000 --- a/test/functional/verify/install-latest-directory/lines-checked +++ /dev/null @@ -1,11 +0,0 @@ -Verifying version 100 -Extracting os-core pack for version 100 -Verifying files -Starting download of remaining update content. This may take a while... -Finishing download of update content... -Adding any missing files -Inspected 1 files - 1 files were missing - 1 of 1 missing files were replaced - 0 of 1 missing files were not replaced -Fix successful diff --git a/test/functional/verify/install-latest-directory/target-dir/usr/lib/os-release b/test/functional/verify/install-latest-directory/target-dir/usr/lib/os-release deleted file mode 100644 index e65580ca..00000000 --- a/test/functional/verify/install-latest-directory/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=100 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/install-latest-directory/test.bats b/test/functional/verify/install-latest-directory/test.bats deleted file mode 100755 index ce174eaf..00000000 --- a/test/functional/verify/install-latest-directory/test.bats +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e - -setup() { - clean_test_dir - create_manifest_tar 100 MoM - sign_manifest_mom 100 - create_manifest_tar 100 os-core - chown_root "$DIR/web-dir/100/staged/$targetfile" - tar -C "$DIR/web-dir/100" -cf "$DIR/web-dir/100/pack-os-core-from-0.tar" --exclude=staged/$targetfile/* staged/$targetfile -} - -teardown() { - clean_tars 100 - revert_chown_root "$DIR/web-dir/100/staged/$targetfile" - sudo rmdir "$DIR/target-dir/usr/bin/" -} - -@test "verify install a directory using latest" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m latest" - - check_lines "$output" - [ -d "$DIR/target-dir/usr/bin" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/install-latest-directory/web-dir/100/Manifest.MoM b/test/functional/verify/install-latest-directory/web-dir/100/Manifest.MoM deleted file mode 100644 index f14ff4ab..00000000 --- a/test/functional/verify/install-latest-directory/web-dir/100/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 26e45e3e60cf47097f2ff2f5b41ba9512bc3793b5351a60a9fe49ea80fd4b5fe 100 os-core diff --git a/test/functional/verify/install-latest-directory/web-dir/100/Manifest.os-core b/test/functional/verify/install-latest-directory/web-dir/100/Manifest.os-core deleted file mode 100644 index fd0680b1..00000000 --- a/test/functional/verify/install-latest-directory/web-dir/100/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 100 -previous: 10 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 100 /usr/bin diff --git a/test/functional/verify/install-latest-directory/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore b/test/functional/verify/install-latest-directory/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/test/functional/verify/install-latest-directory/web-dir/100/staged/6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/test/functional/verify/install-latest-directory/web-dir/version/formatstaging/latest b/test/functional/verify/install-latest-directory/web-dir/version/formatstaging/latest deleted file mode 100644 index 29d6383b..00000000 --- a/test/functional/verify/install-latest-directory/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/test/functional/verify/latest-missing/lines-checked b/test/functional/verify/latest-missing/lines-checked deleted file mode 100644 index 2065643b..00000000 --- a/test/functional/verify/latest-missing/lines-checked +++ /dev/null @@ -1,2 +0,0 @@ -Curl error: (37) Couldn't read a file:// file -Failed verify initialization, exiting now. diff --git a/test/functional/verify/latest-missing/target-dir/usr/lib/os-release b/test/functional/verify/latest-missing/target-dir/usr/lib/os-release deleted file mode 100644 index e65580ca..00000000 --- a/test/functional/verify/latest-missing/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=100 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/latest-missing/test.bats b/test/functional/verify/latest-missing/test.bats deleted file mode 100755 index dce6f0e0..00000000 --- a/test/functional/verify/latest-missing/test.bats +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -@test "verify install using latest with missing version file on server" { - run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m latest" - - check_lines "$(echo "$output" | uniq)" -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/picky-ghosted-missing/lines-checked b/test/functional/verify/picky-ghosted-missing/lines-checked deleted file mode 100644 index fbf50415..00000000 --- a/test/functional/verify/picky-ghosted-missing/lines-checked +++ /dev/null @@ -1,9 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -REGEXP:--picky removing extra files under .* -Inspected 3 files - 0 files were missing - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/picky-ghosted-missing/target-dir.bak/usr/lib/os-release b/test/functional/verify/picky-ghosted-missing/target-dir.bak/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/picky-ghosted-missing/target-dir.bak/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/picky-ghosted-missing/target-dir/usr/lib/os-release b/test/functional/verify/picky-ghosted-missing/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/picky-ghosted-missing/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/picky-ghosted-missing/test.bats b/test/functional/verify/picky-ghosted-missing/test.bats deleted file mode 100755 index 0f4d5d8f..00000000 --- a/test/functional/verify/picky-ghosted-missing/test.bats +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root -R "$DIR/target-dir" -} - -teardown() { - clean_tars 10 - sudo cp -r "$DIR/target-dir.bak/usr" "$DIR/target-dir/" - revert_chown_root -R "$DIR/target-dir" -} - -@test "verify ghosted file not added during --picky" { - run sudo sh -c "$SWUPD verify --fix --picky $SWUPD_OPTS" - - [ $status -eq 0 ] - check_lines "$output" - # this should not exist at the end, despite being marked in the Manifest as - # "ghosted". In this case ghosted files should be ignored. - [ ! -f "$DIR/target-dir/usr/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.MoM b/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.MoM deleted file mode 100644 index 9939a3af..00000000 --- a/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 3adc3fb46d04589a96cbd0e6ea2f4a7aef7566daec64778b12865bd67aa160b0 10 os-core diff --git a/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.os-core b/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.os-core deleted file mode 100644 index a19ea445..00000000 --- a/test/functional/verify/picky-ghosted-missing/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr -.g.. 17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 10 /usr/foo -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 10 /usr/lib -F... 8b77bb0234b3e202a8e27bc1b4d20c9ca48582519717c8379fb58078feaa5f7a 10 /usr/lib/os-release diff --git a/test/functional/verify/picky-ghosted-missing/web-dir/10/files/17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 b/test/functional/verify/picky-ghosted-missing/web-dir/10/files/17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 deleted file mode 100644 index 37bfb8c6..00000000 --- a/test/functional/verify/picky-ghosted-missing/web-dir/10/files/17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 +++ /dev/null @@ -1,5 +0,0 @@ - .-. - (o o) boo! - | O \ - \ \ - `~~~' diff --git a/test/functional/verify/picky-ghosted-missing/web-dir/version/formatstaging/latest b/test/functional/verify/picky-ghosted-missing/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/picky-ghosted-missing/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/picky-ghosted/lines-checked b/test/functional/verify/picky-ghosted/lines-checked deleted file mode 100644 index 017f6266..00000000 --- a/test/functional/verify/picky-ghosted/lines-checked +++ /dev/null @@ -1,9 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -REGEXP:--picky removing extra files under .* -Inspected 4 files - 0 files were missing - 0 files found which should be deleted -Fix successful diff --git a/test/functional/verify/picky-ghosted/target-dir.bak/usr/foo b/test/functional/verify/picky-ghosted/target-dir.bak/usr/foo deleted file mode 100644 index 37bfb8c6..00000000 --- a/test/functional/verify/picky-ghosted/target-dir.bak/usr/foo +++ /dev/null @@ -1,5 +0,0 @@ - .-. - (o o) boo! - | O \ - \ \ - `~~~' diff --git a/test/functional/verify/picky-ghosted/target-dir.bak/usr/lib/os-release b/test/functional/verify/picky-ghosted/target-dir.bak/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/picky-ghosted/target-dir.bak/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/picky-ghosted/target-dir/usr/foo b/test/functional/verify/picky-ghosted/target-dir/usr/foo deleted file mode 100644 index 37bfb8c6..00000000 --- a/test/functional/verify/picky-ghosted/target-dir/usr/foo +++ /dev/null @@ -1,5 +0,0 @@ - .-. - (o o) boo! - | O \ - \ \ - `~~~' diff --git a/test/functional/verify/picky-ghosted/target-dir/usr/lib/os-release b/test/functional/verify/picky-ghosted/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/picky-ghosted/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/picky-ghosted/test.bats b/test/functional/verify/picky-ghosted/test.bats deleted file mode 100755 index e482c5ce..00000000 --- a/test/functional/verify/picky-ghosted/test.bats +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root -R "$DIR/target-dir" -} - -teardown() { - clean_tars 10 - sudo cp -r "$DIR/target-dir.bak/usr" "$DIR/target-dir/" - revert_chown_root -R "$DIR/target-dir" -} - -@test "verify ghosted file skipped during --picky" { - run sudo sh -c "$SWUPD verify --fix --picky $SWUPD_OPTS" - - [ $status -eq 0 ] - check_lines "$output" - # this should exist at the end, despite being marked as "ghosted" in the - # Manifest. With the ghosted file existing under /usr this test is to make - # sure the ghosted files aren't removed during the --picky flow. - [ -f "$DIR/target-dir/usr/foo" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/picky-ghosted/web-dir/10/Manifest.MoM b/test/functional/verify/picky-ghosted/web-dir/10/Manifest.MoM deleted file mode 100644 index ec686a7d..00000000 --- a/test/functional/verify/picky-ghosted/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... 5d2f97d49149d49a24091a24858f5609bfa9d6a7c8306a071d46970b4960b7cb 10 os-core diff --git a/test/functional/verify/picky-ghosted/web-dir/10/Manifest.os-core b/test/functional/verify/picky-ghosted/web-dir/10/Manifest.os-core deleted file mode 100644 index eb5d90af..00000000 --- a/test/functional/verify/picky-ghosted/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,11 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 0 /usr -.g.. 17a3a547dc2ccfd56bf13f9ed90d086d0d5967127086f223a4a514c7c468ed19 10 /usr/foo -D... 6c27df6efcd6fc401ff1bc67c970b83eef115f6473db4fb9d57e5de317eba96e 0 /usr/lib -F... 8b77bb0234b3e202a8e27bc1b4d20c9ca48582519717c8379fb58078feaa5f7a 0 /usr/lib/os-release diff --git a/test/functional/verify/picky-ghosted/web-dir/version/formatstaging/latest b/test/functional/verify/picky-ghosted/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/picky-ghosted/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/skip-scripts/lines-checked b/test/functional/verify/skip-scripts/lines-checked deleted file mode 100644 index 713d1413..00000000 --- a/test/functional/verify/skip-scripts/lines-checked +++ /dev/null @@ -1,9 +0,0 @@ -Verifying version 10 -Verifying files -Adding any missing files -Fixing modified files -Inspected 0 files - 0 files were missing - 0 files found which should be deleted -WARNING: post-update helper scripts skipped due to --no-scripts argument -Fix successful diff --git a/test/functional/verify/skip-scripts/target-dir/usr/lib/os-release b/test/functional/verify/skip-scripts/target-dir/usr/lib/os-release deleted file mode 100644 index d20f3873..00000000 --- a/test/functional/verify/skip-scripts/target-dir/usr/lib/os-release +++ /dev/null @@ -1,9 +0,0 @@ -NAME="Clear Linux Software for Intel Architecture" -VERSION=1 -ID=clear-linux-os -VERSION_ID=10 -PRETTY_NAME="Clear Linux Software for Intel Architecture" -ANSI_COLOR="1;35" -HOME_URL="https://clearlinux.org" -SUPPORT_URL="https://clearlinux.org" -BUG_REPORT_URL="https://bugs.clearlinux.org/jira" diff --git a/test/functional/verify/skip-scripts/target-dir/usr/lib/testfile b/test/functional/verify/skip-scripts/target-dir/usr/lib/testfile deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/skip-scripts/target-dir/usr/lib/testfile +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/skip-scripts/test.bats b/test/functional/verify/skip-scripts/test.bats deleted file mode 100755 index 0da2f8f5..00000000 --- a/test/functional/verify/skip-scripts/test.bats +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bats - -load "../../swupdlib" - -targetfile=e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 - -setup() { - clean_test_dir - create_manifest_tar 10 MoM - sign_manifest_mom 10 - create_manifest_tar 10 os-core - chown_root "$DIR/target-dir/usr/lib/testfile" - create_fullfile_tar 10 $targetfile -} - -teardown() { - clean_tars 10 - clean_tars 10 files - revert_chown_root "$DIR/web-dir/10/files/$targetfile" - sudo rm "$DIR/target-dir/usr/lib/testfile" - cp "$DIR/web-dir/10/files/$targetfile" "$DIR/target-dir/usr/lib/testfile" -} - -@test "verify override post-update scripts" { - run sudo sh -c "$SWUPD verify --fix --no-scripts $SWUPD_OPTS" - - # check for the warning - check_lines "$output" - # this should exist at the end, even if the scripts are not run - [ -f "$DIR/target-dir/usr/lib/testfile" ] -} - -# vi: ft=sh ts=8 sw=2 sts=2 et tw=80 diff --git a/test/functional/verify/skip-scripts/web-dir/10/Manifest.MoM b/test/functional/verify/skip-scripts/web-dir/10/Manifest.MoM deleted file mode 100644 index 9dbde5b9..00000000 --- a/test/functional/verify/skip-scripts/web-dir/10/Manifest.MoM +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451940175 -contentsize: 0 - -M... d3a72b23cbf54d97b50cc3ff2ee1cae17082c67fde83ceb718bf90f54c94ac43 10 os-core diff --git a/test/functional/verify/skip-scripts/web-dir/10/Manifest.os-core b/test/functional/verify/skip-scripts/web-dir/10/Manifest.os-core deleted file mode 100644 index 152416e6..00000000 --- a/test/functional/verify/skip-scripts/web-dir/10/Manifest.os-core +++ /dev/null @@ -1,8 +0,0 @@ -MANIFEST 3 -version: 10 -previous: 0 -filecount: 1 -timestamp: 1451936779 -contentsize: 17929151 - -.db. 0000000000000000000000000000000000000000000000000000000000000000 10 /usr/lib/testfile diff --git a/test/functional/verify/skip-scripts/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 b/test/functional/verify/skip-scripts/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 deleted file mode 100644 index 1304258b..00000000 --- a/test/functional/verify/skip-scripts/web-dir/10/files/e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 +++ /dev/null @@ -1 +0,0 @@ -test boot file diff --git a/test/functional/verify/skip-scripts/web-dir/version/formatstaging/latest b/test/functional/verify/skip-scripts/web-dir/version/formatstaging/latest deleted file mode 100644 index f599e28b..00000000 --- a/test/functional/verify/skip-scripts/web-dir/version/formatstaging/latest +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/test/functional/verify/verify-add-missing-directory.bats b/test/functional/verify/verify-add-missing-directory.bats new file mode 100755 index 00000000..7c7cea44 --- /dev/null +++ b/test/functional/verify/verify-add-missing-directory.bats @@ -0,0 +1,39 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -d /foo/bar "$TEST_NAME" + # remove the directory that is part of the bundle + sudo rm -rf "$TARGETDIR"/foo/bar + +} + +@test "verify add missing directory" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Missing file: .*/target-dir/foo/bar + .fixed + Fixing modified files + Inspected 5 files + 1 files were missing + 1 of 1 missing files were replaced + 0 of 1 missing files were not replaced + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_exists "$TEST_NAME"/target-dir/foo/bar + +} diff --git a/test/functional/verify/verify-add-missing-include-old.bats b/test/functional/verify/verify-add-missing-include-old.bats new file mode 100755 index 00000000..75c07385 --- /dev/null +++ b/test/functional/verify/verify-add-missing-include-old.bats @@ -0,0 +1,46 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle1 -f /test-file1 "$TEST_NAME" + create_bundle -n test-bundle2 -f /test-file2 "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle1 --header-only + add_dependency_to_manifest "$WEBDIR"/100/Manifest.test-bundle1 test-bundle2 + set_current_version "$TEST_NAME" 100 + +} + +@test "verify add missing old include" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 100 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Missing file: .*/target-dir/test-file2 + .fixed + Missing file: .*/target-dir/usr/share/clear/bundles/test-bundle2 + .fixed + Fixing modified files + Inspected 6 files + 2 files were missing + 2 of 2 missing files were replaced + 0 of 2 missing files were not replaced + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + assert_file_exists "$TARGETDIR"/test-file1 + assert_file_exists "$TARGETDIR"/test-file2 + +} diff --git a/test/functional/verify/verify-add-missing-include.bats b/test/functional/verify/verify-add-missing-include.bats new file mode 100755 index 00000000..a4f41ba8 --- /dev/null +++ b/test/functional/verify/verify-add-missing-include.bats @@ -0,0 +1,47 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle1 -f /foo/test-file1 "$TEST_NAME" + create_bundle -n test-bundle2 -f /bar/test-file2 "$TEST_NAME" + # add test-bundle2 and os-core as dependency of test-bundle1 + add_dependency_to_manifest "$WEBDIR"/10/Manifest.test-bundle1 os-core + add_dependency_to_manifest "$WEBDIR"/10/Manifest.test-bundle1 test-bundle2 + +} + +@test "verify add missing include" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Missing file: .*/target-dir/bar + .fixed + Missing file: .*/target-dir/bar/test-file2 + .fixed + Missing file: .*/target-dir/usr/share/clear/bundles/test-bundle2 + .fixed + Fixing modified files + Inspected 8 files + 3 files were missing + 3 of 3 missing files were replaced + 0 of 3 missing files were not replaced + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/core + assert_file_exists "$TARGETDIR"/foo/test-file1 + assert_file_exists "$TARGETDIR"/bar/test-file2 + +} diff --git a/test/functional/verify/verify-boot-file-deleted.bats b/test/functional/verify/verify-boot-file-deleted.bats new file mode 100755 index 00000000..232cf519 --- /dev/null +++ b/test/functional/verify/verify-boot-file-deleted.bats @@ -0,0 +1,33 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -f /usr/lib/kernel/testfile "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /usr/lib/kernel/testfile .db. + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /usr/lib/kernel/testfile "$zero_hash" + +} + +@test "verify add missing boot file" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + Inspected 4 files + 0 files were missing + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} diff --git a/test/functional/verify/verify-boot-file-mismatch-fix.bats b/test/functional/verify/verify-boot-file-mismatch-fix.bats new file mode 100755 index 00000000..8099a51c --- /dev/null +++ b/test/functional/verify/verify-boot-file-mismatch-fix.bats @@ -0,0 +1,40 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/lib/kernel/testfile "$TEST_NAME" + # change the content of testfile so the hash doesn't match + write_to_protected_file -a "$TARGETDIR"/usr/lib/kernel/testfile "some new content" + +} + +@test "verify fix incorrect boot file" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS --fix" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Fixing modified files + .Hash mismatch for file: .*/target-dir/usr/lib/kernel/testfile + .fixed + Inspected 7 files + 0 files were missing + 1 files did not match + 1 of 1 files were fixed + 0 of 1 files were not fixed + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} diff --git a/test/functional/verify/verify-boot-file-mismatch.bats b/test/functional/verify/verify-boot-file-mismatch.bats new file mode 100755 index 00000000..6d0da525 --- /dev/null +++ b/test/functional/verify/verify-boot-file-mismatch.bats @@ -0,0 +1,30 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/lib/kernel/testfile "$TEST_NAME" + # change the content of testfile so the hash doesn't match + write_to_protected_file -a "$TARGETDIR"/usr/lib/kernel/testfile "some new content" + +} + +@test "verify check incorrect boot file" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + .Hash mismatch for file: .*/target-dir/usr/lib/kernel/testfile + Inspected 7 files + 1 files did not match + Verify successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} diff --git a/test/functional/verify/verify-boot-skip.bats b/test/functional/verify/verify-boot-skip.bats new file mode 100755 index 00000000..e4fb17af --- /dev/null +++ b/test/functional/verify/verify-boot-skip.bats @@ -0,0 +1,35 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -f /usr/lib/kernel/testfile "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /usr/lib/kernel/testfile .db. + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /usr/lib/kernel/testfile "$zero_hash" + +} + +@test "verify override boot update" { + + run sudo sh -c "$SWUPD verify --fix -b $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + Inspected 4 files + 0 files were missing + 0 files found which should be deleted + Calling post-update helper scripts. + WARNING: boot files update skipped due to --no-boot-update argument + Fix successful + EOM + ) + assert_is_output "$expected_output" + # this should exist at the end, even if cbm is not run + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +} \ No newline at end of file diff --git a/test/functional/verify/verify-check-missing-directory.bats b/test/functional/verify/verify-check-missing-directory.bats new file mode 100755 index 00000000..f50d2497 --- /dev/null +++ b/test/functional/verify/verify-check-missing-directory.bats @@ -0,0 +1,31 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -d /foo "$TEST_NAME" + # remove the directory /usr/bin from the target-dir + sudo rm -rf "$TARGETDIR"/foo + +} + +@test "verify check missing directory" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + .Hash mismatch for file: .*/target-dir/foo + Inspected 4 files + 1 files did not match + Verify successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_not_exists "$TARGETDIR"/foo + +} + diff --git a/test/functional/verify_v2/verify-client-certificate.bats b/test/functional/verify/verify-client-certificate.bats similarity index 100% rename from test/functional/verify_v2/verify-client-certificate.bats rename to test/functional/verify/verify-client-certificate.bats diff --git a/test/functional/verify/verify-directory-tree-deleted.bats b/test/functional/verify/verify-directory-tree-deleted.bats new file mode 100755 index 00000000..9afc8c51 --- /dev/null +++ b/test/functional/verify/verify-directory-tree-deleted.bats @@ -0,0 +1,45 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -f /testdir1/testdir2/testfile "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /testdir1/testdir2/testfile .d.. + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /testdir1/testdir2 .d.. + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /testdir1 .d.. + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /testdir1/testdir2/testfile "$zero_hash" + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /testdir1/testdir2 "$zero_hash" + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /testdir1 "$zero_hash" + +} + + +@test "verify delete directory tree" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + Deleted .*/target-dir/testdir1/testdir2/testfile + Deleted .*/target-dir/testdir1/testdir2 + Deleted .*/target-dir/testdir1 + Inspected 1 files + 0 files were missing + 3 files found which should be deleted + 3 of 3 files were deleted + 0 of 3 files were not deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_not_exists "$TARGETDIR"/testdir1 + assert_dir_not_exists "$TARGETDIR"/testdir1/testdir2 + assert_file_not_exists "$TARGETDIR"/testdir1/testdir2/testfile + +} diff --git a/test/functional/verify/verify-empty-dir-deleted.bats b/test/functional/verify/verify-empty-dir-deleted.bats new file mode 100755 index 00000000..4386401b --- /dev/null +++ b/test/functional/verify/verify-empty-dir-deleted.bats @@ -0,0 +1,36 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -d /testdir "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /testdir .d.. + update_manifest "$WEBDIR"/10/Manifest.os-core file-hash /testdir "$zero_hash" + +} + +@test "verify delete already removed directory" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + Deleted .*/target-dir/testdir + Inspected 1 files + 0 files were missing + 1 files found which should be deleted + 1 of 1 files were deleted + 0 of 1 files were not deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + assert_dir_not_exists "$TARGETDIR"/testdir + +} diff --git a/test/functional/verify/verify-fix-version-mismatch-override.bats b/test/functional/verify/verify-fix-version-mismatch-override.bats new file mode 100755 index 00000000..d979bc3b --- /dev/null +++ b/test/functional/verify/verify-fix-version-mismatch-override.bats @@ -0,0 +1,42 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -d /usr/bin "$TEST_NAME" + create_version "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" os-core --header-only + set_current_version "$TEST_NAME" 20 + # remove /usr/bin so it is missing in the target system + sudo rm -rf "$TARGETDIR"/usr/bin + +} + +@test "verify version mismatch override" { + + run sudo sh -c "$SWUPD verify --fix -m 10 --force $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + WARNING: the force or picky option is specified; ignoring version mismatch for verify --fix + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Missing file: .+/target-dir/usr/bin + .fixed + Fixing modified files + Inspected 3 files + 1 files were missing + 1 of 1 missing files were replaced + 0 of 1 missing files were not replaced + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + +} diff --git a/test/functional/verify/verify-fix-version-mismatch.bats b/test/functional/verify/verify-fix-version-mismatch.bats new file mode 100755 index 00000000..19935274 --- /dev/null +++ b/test/functional/verify/verify-fix-version-mismatch.bats @@ -0,0 +1,26 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_version "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" os-core --add-dir /usr/bin + set_current_version "$TEST_NAME" 20 + +} + +@test "verify version mismatch enforcement" { + + run sudo sh -c "$SWUPD verify --fix -m 10 $SWUPD_OPTS" + assert_status_is "$EMANIFEST_LOAD" + expected_output=$(cat <<-EOM + Verifying version 10 + ERROR: Fixing to a different version requires --force or --picky + Error: Fix did not fully succeed + EOM + ) + assert_is_output "$expected_output" + +} \ No newline at end of file diff --git a/test/functional/verify/verify-format-mismatch-override.bats b/test/functional/verify/verify-format-mismatch-override.bats new file mode 100755 index 00000000..018901d0 --- /dev/null +++ b/test/functional/verify/verify-format-mismatch-override.bats @@ -0,0 +1,48 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -u "$TEST_NAME" 10 1 + bump_format "$TEST_NAME" + create_version -u "$TEST_NAME" 40 30 2 + update_bundle "$TEST_NAME" os-core --add-dir /usr/bin + +} + +@test "verify format mismatch override" { + + # the -x option bypasses the fatal error + run sudo sh -c "$SWUPD verify --fix -F 1 -m 40 -x $SWUPD_OPTS_NO_FMT" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 40 + WARNING: the force option is specified; ignoring format mismatch for verify + WARNING: the force or picky option is specified; ignoring version mismatch for verify --fix + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Missing file: .+/target-dir/usr/bin + .fixed + Fixing modified files + .Hash mismatch for file: .*/target-dir/usr/lib/os-release + .fixed + Hash mismatch for file: .*/target-dir/usr/share/defaults/swupd/format + .fixed + Inspected 10 files + 1 files were missing + 1 of 1 missing files were replaced + 0 of 1 missing files were not replaced + 2 files did not match + 2 of 2 files were fixed + 0 of 2 files were not fixed + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + +} \ No newline at end of file diff --git a/test/functional/verify/verify-format-mismatch.bats b/test/functional/verify/verify-format-mismatch.bats new file mode 100755 index 00000000..b56a1859 --- /dev/null +++ b/test/functional/verify/verify-format-mismatch.bats @@ -0,0 +1,26 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -u "$TEST_NAME" 10 1 + bump_format "$TEST_NAME" + create_version -u "$TEST_NAME" 40 30 2 + +} + +@test "verify format mismatch enforcement" { + + run sudo sh -c "$SWUPD verify --fix -F 1 -m 40 $SWUPD_OPTS_NO_FMT" + assert_status_is "$EMANIFEST_LOAD" + expected_output=$(cat <<-EOM + Verifying version 40 + ERROR: Mismatching formats detected when verifying 40 (expected: 1; actual: 2) + Latest supported version to verify: 20 + Error: Fix did not fully succeed + EOM + ) + assert_is_output "$expected_output" + +} diff --git a/test/functional/verify/verify-ghosted.bats b/test/functional/verify/verify-ghosted.bats new file mode 100755 index 00000000..cadcd0d3 --- /dev/null +++ b/test/functional/verify/verify-ghosted.bats @@ -0,0 +1,34 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -e "$TEST_NAME" + create_bundle -L -n os-core -f /foo "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.os-core file-status /foo .g.. + +} + +@test "verify ghosted file skipped" { + + run sudo sh -c "$SWUPD verify --fix $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + Inspected 1 files + 0 files were missing + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_is_output "$expected_output" + # this should exist at the end, despite being marked as "ghosted" in the + # Manifest and treated as deleted for parts of swupd-client. + assert_file_exists "$TARGETDIR"/foo + +} diff --git a/test/functional/verify/verify-install-directory.bats b/test/functional/verify/verify-install-directory.bats new file mode 100755 index 00000000..ca4a8c66 --- /dev/null +++ b/test/functional/verify/verify-install-directory.bats @@ -0,0 +1,38 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -d /foo/bar "$TEST_NAME" + # remove the directory bar from the target-dir + sudo rm -rf "$TARGETDIR"/foo/bar + +} + +@test "verify install directory" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m 10" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Downloading packs... + Extracting os-core pack for version 10 + Extracting test-bundle pack for version 10 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Inspected 5 files + 1 files were missing + 1 of 1 missing files were replaced + 0 of 1 missing files were not replaced + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_is_output "$expected_output" + assert_dir_exists "$TARGETDIR"/foo/bar + +} diff --git a/test/functional/verify/verify-install-latest-directory.bats b/test/functional/verify/verify-install-latest-directory.bats new file mode 100755 index 00000000..deab5780 --- /dev/null +++ b/test/functional/verify/verify-install-latest-directory.bats @@ -0,0 +1,38 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -d /foo/bar "$TEST_NAME" + create_version "$TEST_NAME" 100 10 + update_bundle "$TEST_NAME" test-bundle --add-dir /foo/baz + +} + +@test "verify install a directory using latest" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m latest" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 100 + Downloading packs... + Extracting os-core pack for version 10 + Extracting test-bundle pack for version 100 + Verifying files + Starting download of remaining update content. This may take a while... + Finishing download of update content... + Adding any missing files + Inspected 6 files + 1 files were missing + 1 of 1 missing files were replaced + 0 of 1 missing files were not replaced + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_is_output "$expected_output" + assert_dir_exists "$TARGETDIR"/foo/baz + +} diff --git a/test/functional/verify/verify-latest-missing.bats b/test/functional/verify/verify-latest-missing.bats new file mode 100755 index 00000000..0be74b45 --- /dev/null +++ b/test/functional/verify/verify-latest-missing.bats @@ -0,0 +1,33 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + # remove the formatstaging/latest + sudo rm -rf "$WEBDIR" + +} + +test_teardown() { + + # we need to manually clean this up because the destroy_test_environment + # function will refuse to delete this since the test environment does not + # look like a test environment anymore (missing web-dir) + sudo rm -rf "$TEST_NAME" + +} + +@test "verify install using latest with missing version file on server" { + + run sudo sh -c "$SWUPD verify $SWUPD_OPTS --install -m latest" + assert_status_is_not 0 + expected_output=$(cat <<-EOM + Curl error: \(37\) Couldn.t read a file:// file + Failed verify initialization, exiting now. + EOM + ) + assert_regex_is_output "$expected_output" + +} diff --git a/test/functional/verify/verify-picky-ghosted-missing.bats b/test/functional/verify/verify-picky-ghosted-missing.bats new file mode 100755 index 00000000..89a08979 --- /dev/null +++ b/test/functional/verify/verify-picky-ghosted-missing.bats @@ -0,0 +1,37 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -u "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/foo -d/usr/share/clear/bundles "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.test-bundle file-status /usr/foo .g.. + # since the files must have been installed by the -L option, remove /usr/foo + sudo rm -f "$TARGETDIR"/usr/foo + +} + +@test "verify ghosted file not added during --picky" { + + run sudo sh -c "$SWUPD verify --fix --picky $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + --picky removing extra files under .* + Inspected 11 files + 0 files were missing + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + # this should not exist at the end, despite being marked in the Manifest as + # "ghosted". In this case ghosted files should be ignored. + assert_file_not_exists "$TARGETDIR"/usr/foo + +} diff --git a/test/functional/verify/verify-picky-ghosted.bats b/test/functional/verify/verify-picky-ghosted.bats new file mode 100755 index 00000000..12f22bc3 --- /dev/null +++ b/test/functional/verify/verify-picky-ghosted.bats @@ -0,0 +1,36 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment -u "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/foo -d/usr/share/clear/bundles "$TEST_NAME" + update_manifest "$WEBDIR"/10/Manifest.test-bundle file-status /usr/foo .g.. + +} + +@test "verify ghosted file skipped during --picky" { + + run sudo sh -c "$SWUPD verify --fix --picky $SWUPD_OPTS" + assert_status_is 0 + expected_output=$(cat <<-EOM + Verifying version 10 + Verifying files + Adding any missing files + Fixing modified files + --picky removing extra files under .* + Inspected 12 files + 0 files were missing + 0 files found which should be deleted + Calling post-update helper scripts. + Fix successful + EOM + ) + assert_regex_is_output "$expected_output" + # this should exist at the end, despite being marked as "ghosted" in the + # Manifest. With the ghosted file existing under /usr this test is to make + # sure the ghosted files aren't removed during the --picky flow. + assert_file_exists "$TARGETDIR"/usr/foo + +} diff --git a/test/functional/verify/verify-skip-scripts.bats b/test/functional/verify/verify-skip-scripts.bats new file mode 100755 index 00000000..9ead4516 --- /dev/null +++ b/test/functional/verify/verify-skip-scripts.bats @@ -0,0 +1,36 @@ +#!/usr/bin/env bats + +load "../testlib" + +test_setup() { + + create_test_environment "$TEST_NAME" + create_bundle -L -n test-bundle -f /usr/lib/kernel/testfile "$TEST_NAME" + create_version "$TEST_NAME" 20 10 + update_bundle "$TEST_NAME" test-bundle --delete /usr/lib/kernel/testfile + set_current_version "$TEST_NAME" 20 + +} + +@test "verify override post-update scripts" { + + run sudo sh -c "$SWUPD verify --fix --no-scripts $SWUPD_OPTS" + assert_status_is 0 + # check for the warning + expected_output=$(cat <<-EOM + Verifying version 20 + Verifying files + Adding any missing files + Fixing modified files + Inspected 6 files + 0 files were missing + 0 files found which should be deleted + WARNING: post-update helper scripts skipped due to --no-scripts argument + Fix successful + EOM + ) + assert_is_output "$expected_output" + # this should exist at the end, even if the scripts are not run + assert_file_exists "$TARGETDIR"/usr/lib/kernel/testfile + +}