mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-11-21 23:05:22 +00:00
Add functional test for format bump actions field
Adds a functional test to check for the actions: update line in the Manifest.MoM for the new format. Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
+2
-1
@@ -120,7 +120,8 @@ dist_check_SCRIPTS = \
|
||||
test/functional/pack/test.bats \
|
||||
test/functional/state-file/test.bats \
|
||||
test/functional/subtract-delete/test.bats \
|
||||
test/functional/update/test.bats
|
||||
test/functional/update/test.bats \
|
||||
test/functional/format-bump/test.bats
|
||||
|
||||
if RENAMES
|
||||
dist_check_SCRIPTS += \
|
||||
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/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
|
||||
|
||||
set_os_release 20 os-core
|
||||
track_bundle 20 os-core
|
||||
|
||||
set_os_release 30 os-core
|
||||
track_bundle 30 os-core
|
||||
}
|
||||
|
||||
@test "full run update creation with delta packs over format bump" {
|
||||
# build the first version
|
||||
echo $CREATE_UPDATE
|
||||
echo $DIR
|
||||
sudo $CREATE_UPDATE --osversion 10 --statedir $DIR --format 3
|
||||
sudo $MAKE_FULLFILES --statedir $DIR 10
|
||||
sudo $MAKE_PACK --statedir $DIR 0 10 os-core
|
||||
|
||||
set_latest_ver 10
|
||||
|
||||
# then the second version...
|
||||
echo $CREATE_UPDATE
|
||||
echo $DIR
|
||||
sudo $CREATE_UPDATE --osversion 20 --statedir $DIR --format 3
|
||||
sudo $MAKE_FULLFILES --statedir $DIR 20
|
||||
sudo $MAKE_PACK --statedir $DIR 0 20 os-core
|
||||
|
||||
set_latest_ver 20
|
||||
|
||||
# then the third version...
|
||||
echo $CREATE_UPDATE
|
||||
echo $DIR
|
||||
sudo $CREATE_UPDATE --osversion 30 --statedir $DIR --format 4
|
||||
sudo $MAKE_FULLFILES --statedir $DIR 30
|
||||
sudo $MAKE_PACK --statedir $DIR 0 30 os-core
|
||||
|
||||
# zero packs should exist (non-zero size) for all versions
|
||||
[ -s $DIR/www/10/pack-os-core-from-0.tar ]
|
||||
[ -s $DIR/www/20/pack-os-core-from-0.tar ]
|
||||
[ -s $DIR/www/30/pack-os-core-from-0.tar ]
|
||||
|
||||
[[ 0 -eq $(grep '^actions: update$' $DIR/www/10/Manifest.MoM | wc -l) ]]
|
||||
[[ 0 -eq $(grep '^actions: update$' $DIR/www/20/Manifest.MoM | wc -l) ]]
|
||||
[[ 1 -eq $(grep '^actions: update$' $DIR/www/30/Manifest.MoM | wc -l) ]]
|
||||
}
|
||||
|
||||
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|
||||
Reference in New Issue
Block a user