mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-08-27 10:55:55 +00:00
Add functional test for state file tagging
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Executable
+28
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user