diff --git a/testcases/cli-test/unbound/oe_test_service_unbound-keygen.sh b/testcases/cli-test/unbound/oe_test_service_unbound-keygen.sh index 7d846b4dfbd36c4f52f15ec87b71729c3205d662..31235969d340ff73e21b0403f0705b468d5e2f59 100644 --- a/testcases/cli-test/unbound/oe_test_service_unbound-keygen.sh +++ b/testcases/cli-test/unbound/oe_test_service_unbound-keygen.sh @@ -17,10 +17,12 @@ # @Desc : Test unbound-keygen.service restart # ############################################# -source "../common/common_lib.sh" +source "$OET_PATH/testcases/cli-test/common/common_lib.sh" function pre_test() { LOG_INFO "Start environmental preparation." + [ -f /etc/resolv.conf-bak ] || cp /etc/resolv.conf /etc/resolv.conf-bak + echo "nameserver 127.0.0.1" > /etc/resolv.conf DNF_INSTALL unbound service=unbound-keygen.service log_time=$(date '+%Y-%m-%d %T') @@ -55,7 +57,8 @@ function run_test() { function post_test() { LOG_INFO "start environment cleanup." systemctl stop "${service}" - DNF_REMOVE + DNF_REMOVE 1 unbound + [ -f /etc/resolv.conf-bak ] && \cp /etc/resolv.conf-bak /etc/resolv.conf LOG_INFO "Finish environment cleanup!" }