Add file creation test

Ensure that iniadd is creating files that don't exist, as it has
historically done.

Change-Id: I2798996f3d46ff1dce410b815a87395f1bf729f9
This commit is contained in:
Ian Wienand 2015-07-22 13:36:12 +10:00
parent f44a024f02
commit cede787482
2 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,7 @@ function inidelete {
# Set an option in an INI file
# iniset [-sudo] config-file section option value
# - if the file does not exist, it is created
function iniset {
local xtrace=$(set +o | grep xtrace)
set +o xtrace

View File

@ -199,6 +199,11 @@ for x in $del_cases; do
fi
done
# test file-creation
iniset $SUDO_ARG ${INI_TMP_ETC_DIR}/test.new.ini test foo bar
VAL=$(iniget ${INI_TMP_ETC_DIR}/test.new.ini test foo)
assert_equal "$VAL" "bar" "iniset created file"
$SUDO rm -rf ${INI_TMP_DIR}
report_results