New test for issue 412

Create a test-bundle manifest with a stupid number of files, see that
it is rejected. Unfortunately because of retries this takes a long
time (70 seconds) time to run.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
This commit is contained in:
Icarus Sparry
2018-03-19 14:42:22 -07:00
committed by Matthew Johnson
parent e52ba1e7df
commit 87d601d05a
9 changed files with 76 additions and 0 deletions
@@ -0,0 +1,18 @@
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Warning: Removing corrupt Manifest.test-bundle artifacts and re-downloading...
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Failed to load 10 test-bundle manifest
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Warning: Removing corrupt Manifest.test-bundle artifacts and re-downloading...
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Failed to load 10 test-bundle manifest
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Warning: Removing corrupt Manifest.test-bundle artifacts and re-downloading...
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Failed to load 10 test-bundle manifest
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Warning: Removing corrupt Manifest.test-bundle artifacts and re-downloading...
Error: preposterous (9000000) number of files in test-bundle Manifest, more than 4 million skipping
Failed to load 10 test-bundle manifest
Unable to download manifest test-bundle version 10, exiting now
Error: Processing error - Aborting
@@ -0,0 +1,9 @@
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"
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bats
load "../../swupdlib"
setup() {
clean_test_dir
create_manifest_tar 10 MoM
sign_manifest_mom 10
create_manifest_tar 10 test-bundle
}
teardown() {
clean_tars 10
}
@test "bundle-add add bundle with invalid number of files in manifest" {
run sudo sh -c "$SWUPD bundle-add $SWUPD_OPTS test-bundle"
# it will retry a number of times, so takes about 70 seconds
[ "$status" -gt 0 ]
check_lines "$output"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -0,0 +1,14 @@
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
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 9000000
timestamp: 1451936779
contentsize: 17929151
F... e6d85023c5e619eb43d5cfbfdbdec784afef5a82ffa54e8c93bda3e0883360a3 10 /testfile