Replacing old search tests

The old search tests used the swupdlib.bash library that was
replaced by testlib.bash.

This commit replaces those old search tests with new versions
of the same tests that now use testlib.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit is contained in:
Castulo Martinez
2018-09-27 12:48:14 -07:00
committed by Otavio Pontes
parent 808f70cd1c
commit d354652d24
60 changed files with 3 additions and 463 deletions
+3 -10
View File
@@ -155,16 +155,9 @@ BATS = \
test/functional/hashdump/hashdump-file-hash.bats \
test/functional/mirror/mirror-createdir.bats \
test/functional/mirror/mirror-createdir-negative.bats \
test/functional/search/content-check-negfull-path/test.bats \
test/functional/search/content-check-neglibtest/test.bats \
test/functional/search_v2/search-content-check-negative.bats \
test/functional/search/content-check-posbin/test.bats \
test/functional/search/content-check-posebin/test.bats \
test/functional/search/content-check-posfull-path/test.bats \
test/functional/search/content-check-poslib32/test.bats \
test/functional/search/content-check-poslib64/test.bats \
test/functional/search_v2/search-content-check-positive.bats \
test/functional/search_v2/search-client-certificate.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 \
@@ -1 +0,0 @@
Searching for '/usr/lib64/test-lib100'
@@ -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"
@@ -1,24 +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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search with non existant file, specifying full path" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS /usr/lib64/test-lib100"
[ "$status" -eq 0 ]
echo "$output" | grep -q 'Search term not found.'
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for 'libtest-nohit'
@@ -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"
@@ -1,24 +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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search with non existant library" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS -l libtest-nohit"
[ "$status" -eq 0 ]
echo "$output" | grep -q 'Search term not found.'
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for 'test-bin'
@@ -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"
@@ -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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search for a binary" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS -b test-bin"
[ "$status" -eq 0 ]
echo "$output" | grep -q "Bundle test-bundle"
echo "$output" | grep -q "/usr/bin/test-bin"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for 'test-bin'
@@ -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"
@@ -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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search for a file everywhere" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS test-bin"
[ "$status" -eq 0 ]
echo "$output" | grep -q "Bundle test-bundle"
echo "$output" | grep -q "/usr/bin/test-bin"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for '/usr/lib64/test-lib64'
@@ -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"
@@ -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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search for a file specifying the full path" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS /usr/lib64/test-lib64"
[ "$status" -eq 0 ]
echo "$output" | grep -q "Bundle test-bundle"
echo "$output" | grep -q "/usr/lib64/test-lib64"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for 'test-lib32'
@@ -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"
@@ -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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search for a library in lib32" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS -l test-lib32"
[ "$status" -eq 0 ]
echo "$output" | grep -q "Bundle test-bundle"
echo "$output" | grep -q "/usr/lib/test-lib32"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64
@@ -1 +0,0 @@
Searching for 'test-lib64'
@@ -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"
@@ -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 test-bundle
create_manifest_tar 10 os-core
}
teardown() {
clean_tars 10
}
@test "search for a library in lib64" {
run sudo sh -c "$SWUPD search $SWUPD_OPTS -l test-lib64"
[ "$status" -eq 0 ]
echo "$output" | grep -q "Bundle test-bundle"
echo "$output" | grep -q "/usr/lib64/test-lib64"
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
@@ -1,9 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 0
M... 441ca59081cdea809fcbf0880253342a9c0f6ae907df808d2ab41ce0cbec07ca 10 os-core
M... bfea9f6f029bd3339dd302a4ceb52ab0ad2757151ac28328bfc982cf3666ca32 10 test-bundle
@@ -1,8 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -1,12 +0,0 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /libtest-nohit
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-lib32
F.b. a898be783f560f3f3b301c5ca8ee6847595152eb4efc91d5bef4846f9b055e26 10 /usr/lib/test-lib32
F.b. 2e5cac2ded0632fb4f8e849c8f24a5e061cefc46bd17bd0529233c143cecbb21 10 /usr/bin/test-bin
F.b. ba38be783f560f3f32F01c5ca8ee6847595152eb4efc91d5bef4846f9b050f23 10 /usr/lib64/test-lib64