source "${OET_PATH}/libs/locallibs/common_lib.sh"
function pre_test() {
LOG_INFO "Start environmental preparation."
DNF_INSTALL "nmstate"
echo "invalid checkpoint" > ./invalid_checkpoint
LOG_INFO "End of environmental preparation!"
}
function run_test() {
LOG_INFO "Start to run test."
nmstatectl commit ./invalid_checkpoint
CHECK_RESULT $? 1 0 "nmstatectl commit should fail with invalid checkpoint"
LOG_INFO "End of the test."
}
function post_test() {
LOG_INFO "start environment cleanup."
DNF_REMOVE "nmstate"
rm -f ./invalid_checkpoint
LOG_INFO "End of environment cleanup!"
}
main "$@"