Ignore signature verification errors in functional tests

Because signature verification is a feature that we need separate
testing for, and swupd's output may print a verification error (or not)
depending on how swupd was built, add a helper function to remove the
verification error message when swupd is built with verification
enabled. If verification is not enabled, swupd will not print any
message, and the function is a no-op.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2016-06-27 11:56:01 -07:00
parent eecd292ae4
commit 3e0fff6a47
36 changed files with 60 additions and 0 deletions
@@ -24,6 +24,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle pack for version 10" ]
[ "${lines[5]}" = "Extracting pack." ]
@@ -17,6 +17,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "bundle(s) already installed, exiting now" ]
}
@@ -33,6 +33,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle1 pack for version 10" ]
[ "${lines[5]}" = "Extracting pack." ]
@@ -24,6 +24,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle pack for version 10" ]
[ "${lines[5]}" = "Extracting pack." ]
@@ -24,6 +24,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle pack for version 10" ]
[ "${lines[5]}" = "Installing bundle(s) files..." ]
@@ -29,6 +29,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle pack for version 10" ]
[ "${lines[5]}" = "Extracting pack." ]
+1
View File
@@ -17,6 +17,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "os-core" ]
}
@@ -32,6 +32,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Downloading packs..." ]
[ "${lines[4]}" = "Downloading test-bundle pack for version 10" ]
[ "${lines[5]}" = "Extracting pack." ]
@@ -22,6 +22,8 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
ignore_sigverify_error 3
[ "${lines[3]}" = "Deleting bundle files..." ]
[ "${lines[4]}" = "Total deleted files: 1" ]
[ "${lines[5]}" = "Untracking bundle from system..." ]
@@ -19,6 +19,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
[ "${lines[3]}" = "Error: bundle requested to be removed is required by other installed bundles" ]
[ "${lines[4]}" = "Error: Bundle remove failed" ]
[ -f "$DIR/target-dir/test-file" ]
@@ -21,6 +21,8 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 3
ignore_sigverify_error 3
[ "${lines[3]}" = "Deleting bundle files..." ]
[ "${lines[4]}" = "Total deleted files: 1" ]
[ "${lines[5]}" = "Untracking bundle from system..." ]
+10
View File
@@ -67,4 +67,14 @@ create_fullfile_tar() {
# return
# }
ignore_sigverify_error() {
local index="$1"
if [[ "${lines[$index]}" =~ ^WARNING!!!\ FAILED\ TO\ VERIFY\ SIGNATURE\ OF\ Manifest.MoM ]]; then
# remove element from array
unset lines[$index]
# reassign indices
lines=("${lines[@]}")
fi
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -35,7 +35,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Extracting pack." ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
@@ -31,7 +31,9 @@ teardown() {
[ "${lines[6]}" = "Attempting to download version string to memory" ]
[ "${lines[7]}" = "Preparing to update from 10 to 100" ]
[ "${lines[8]}" = "Querying current manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Querying server manifest." ]
ignore_sigverify_error 10
[ "${lines[10]}" = "Downloading os-core pack for version 100" ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[12]}" = " changed manifests : 1" ]
@@ -31,7 +31,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Extracting pack." ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
@@ -47,7 +47,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Downloading test-bundle1 pack for version 100" ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
+2
View File
@@ -68,7 +68,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading test-bundle3 pack for version 100" ]
[ "${lines[10]}" = "Downloading test-bundle4 pack for version 100" ]
[ "${lines[11]}" = "Downloading test-bundle5 pack for version 100" ]
@@ -35,7 +35,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Downloading test-bundle1 pack for version 100" ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
@@ -39,7 +39,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 20 to 30" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 30" ]
[ "${lines[10]}" = "Extracting pack." ]
[ "${lines[11]}" = "Downloading test-bundle2 pack for version 30" ]
@@ -28,7 +28,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading test-bundle pack for version 100" ]
[ "${lines[10]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[11]}" = " changed manifests : 1" ]
@@ -31,7 +31,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[11]}" = " changed manifests : 1" ]
@@ -32,7 +32,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading os-core pack for version 100" ]
[ "${lines[10]}" = "Extracting pack." ]
[ "${lines[11]}" = "Statistics for going from version 10 to version 100:" ]
@@ -41,7 +41,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading test-bundle pack for version 100" ]
[ "${lines[10]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[11]}" = " changed manifests : 1" ]
@@ -43,7 +43,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading test-bundle pack for version 100" ]
[ "${lines[10]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[11]}" = " changed manifests : 1" ]
@@ -31,7 +31,9 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Preparing to update from 10 to 100" ]
[ "${lines[7]}" = "Querying current manifest." ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Querying server manifest." ]
ignore_sigverify_error 9
[ "${lines[9]}" = "Downloading test-bundle pack for version 100" ]
[ "${lines[10]}" = "Statistics for going from version 10 to version 100:" ]
[ "${lines[11]}" = " changed manifests : 1" ]
@@ -24,6 +24,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -40,6 +40,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 100" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -34,6 +34,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -26,6 +26,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -27,6 +27,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -20,6 +20,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Verifying version 10" ]
[ "${lines[3]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 4
[ "${lines[4]}" = "Verifying files" ]
[ "${lines[6]}" = "Inspected 1 files" ]
[ "${lines[7]}" = " 1 files did not match" ]
@@ -18,6 +18,7 @@ teardown() {
echo "$output"
[ "${lines[2]}" = "Verifying version 10" ]
[ "${lines[3]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 4
[ "${lines[4]}" = "Verifying files" ]
[ "${lines[6]}" = "Inspected 1 files" ]
[ "${lines[7]}" = " 1 files did not match" ]
@@ -20,6 +20,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -21,6 +21,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Starting download of remaining update content. This may take a while..." ]
[ "${lines[8]}" = "Finishing download of update content..." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -24,6 +24,7 @@ teardown() {
echo "$output"
[ "${lines[5]}" = "Verifying version 10" ]
[ "${lines[6]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 7
[ "${lines[7]}" = "Downloading os-core pack for version 10" ]
[ "${lines[8]}" = "Extracting pack." ]
[ "${lines[9]}" = "Adding any missing files" ]
@@ -25,6 +25,7 @@ teardown() {
[ "${lines[5]}" = "Attempting to download version string to memory" ]
[ "${lines[6]}" = "Verifying version 100" ]
[ "${lines[7]}" = "Attempting to download version string to memory" ]
ignore_sigverify_error 8
[ "${lines[8]}" = "Downloading os-core pack for version 100" ]
[ "${lines[9]}" = "Extracting pack." ]
[ "${lines[10]}" = "Adding any missing files" ]