Add functional test for state file tagging

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2016-11-18 14:50:15 -08:00
committed by tmarcu
parent fe6f47e4c3
commit 57292a5a03
3 changed files with 32 additions and 3 deletions
+2 -1
View File
@@ -115,7 +115,8 @@ dist_check_SCRIPTS = \
test/functional/pack/test.bats \
test/functional/full-run/test.bats \
test/functional/full-run-delta/test.bats \
test/functional/file-name-blacklisted/test.bats
test/functional/file-name-blacklisted/test.bats \
test/functional/state-file/test.bats
endif
if COVERAGE
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bats
# common functions
load "../swupdlib"
setup() {
clean_test_dir
init_test_dir
init_server_ini
set_latest_ver 0
init_groups_ini os-core
set_os_release 10 os-core
track_bundle 10 os-core
gen_file_plain 10 os-core "/var/lib/test"
}
@test "state file marked in manifest" {
sudo $CREATE_UPDATE --osversion 10 --statedir $DIR --format 3
# a file and dir installed in /var should be marked state
grep '^D\.s\..*/var/lib$' $DIR/www/10/Manifest.os-core
grep '^F\.s\..*/var/lib/test$' $DIR/www/10/Manifest.os-core
}
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
+2 -2
View File
@@ -91,7 +91,7 @@ gen_file_plain() {
local name="$3"
# Add plain text file into a bundle
mkdir -p $DIR/image/$ver/$bundle
mkdir -p $DIR/image/$ver/$bundle/$(dirname "$name")
echo "$name" > $DIR/image/$ver/$bundle/"$name"
}
@@ -101,7 +101,7 @@ gen_file_plain_change() {
local name="$3"
# Add plain text file into a bundle
mkdir -p $DIR/image/$ver/$bundle
mkdir -p $DIR/image/$ver/$bundle/$(dirname "$name")
echo "$ver $name" > $DIR/image/$ver/$bundle/"$name"
}