diff --git a/tests/test_helpers.v2.1.d/ynhtest_config.sh b/tests/test_helpers.v2.1.d/ynhtest_config.sh index 51fd44cfe..ac7c2f853 100644 --- a/tests/test_helpers.v2.1.d/ynhtest_config.sh +++ b/tests/test_helpers.v2.1.d/ynhtest_config.sh @@ -63,7 +63,7 @@ EOF test "$(ynh_read_var_in_file --file="$file" --key="user")" == "camille" - test "$(ynh_read_var_in_file --file="$file" --key="TITLE" --after"YNH_ICI")" == "Hello world" + test "$(ynh_read_var_in_file --file="$file" --key="TITLE" --after="YNH_ICI")" == "Hello world" ! _read_py "$file" "NONEXISTENT" test "$(ynh_read_var_in_file --file="$file" --key="NONEXISTENT")" == "YNH_NULL" @@ -123,8 +123,8 @@ EOF ynh_write_var_in_file --file="$file" --key="ldap_base" --value="ou=users,dc=yunohost,dc=org" test "$(ynh_read_var_in_file --file="$file" --key="ldap_base")" == "ou=users,dc=yunohost,dc=org" - ynh_write_var_in_file --file="$file" --key="TITLE" --value="YOLO" --after"YNH_ICI" - test "$(ynh_read_var_in_file --file="$file" --key="TITLE" --after"YNH_ICI")" == "YOLO" + ynh_write_var_in_file --file="$file" --key="TITLE" --value="YOLO" --after="YNH_ICI" + test "$(ynh_read_var_in_file --file="$file" --key="TITLE" --after="YNH_ICI")" == "YOLO" ! ynh_write_var_in_file --file="$file" --key="NONEXISTENT" --value="foobar" ! _read_py "$file" "NONEXISTENT" @@ -251,8 +251,8 @@ EOF test "$(_read_ini "$file" "url")" == "https://domain.tld/foobar" test "$(ynh_read_var_in_file --file="$file" --key="url")" == "https://domain.tld/foobar" - ynh_write_var_in_file "$file" "ldap_base" "ou=users,dc=yunohost,dc=org" - test "$(ynh_read_var_in_file --file="$file" --key="ldap_base")" == "ou=users,dc=yunohost,dc=org" + ynh_write_var_in_file --file="$file" --key="ldap_base" --value="ou=users,dc=yunohost,dc=org" + test "$(ynh_read_var_in_file --file="$file" --key="ldap_base")" == "ou=users,dc=yunohost,dc=org" ! ynh_write_var_in_file --file="$file" --key="nonexistent" "foobar" ! _read_ini "$file" "nonexistent" diff --git a/tests/test_helpers.v2.1.d/ynhtest_setup_source.sh b/tests/test_helpers.v2.1.d/ynhtest_setup_source.sh index 9953df406..0b9d2e665 100644 --- a/tests/test_helpers.v2.1.d/ynhtest_setup_source.sh +++ b/tests/test_helpers.v2.1.d/ynhtest_setup_source.sh @@ -33,7 +33,6 @@ EOF ynhtest_setup_source_nominal() { install_dir="$(mktemp -d -p $VAR_WWW)" _make_dummy_manifest > ../manifest.toml - cat ../manifest.toml # debug ynh_setup_source --dest_dir="$install_dir" --source_id="dummy" @@ -48,6 +47,7 @@ ynhtest_setup_source_no_group_in_manifest() { install_dir="$(mktemp -d -p $VAR_WWW)" _make_dummy_manifest > ../manifest.toml sed '/www-data/d' -i ../manifest.toml + cat ../manifest.toml # debug ynh_setup_source --dest_dir="$install_dir" --source_id="dummy" diff --git a/tests/test_helpers.v2.1.d/ynhtest_templating.sh b/tests/test_helpers.v2.1.d/ynhtest_templating.sh index 703c915d2..b8cea0770 100644 --- a/tests/test_helpers.v2.1.d/ynhtest_templating.sh +++ b/tests/test_helpers.v2.1.d/ynhtest_templating.sh @@ -15,7 +15,7 @@ EOF ynh_config_add --template="$template" --destination="$VAR_WWW/config.txt" test "$(cat $VAR_WWW/config.txt)" == "$(echo -ne 'app=ynhtest\nfoo=bar')" - test "$(ls -l $VAR_WWW/config.txt | cut -d' ' -f1-4)" == "-rw-r----- 1 ynhtest ynhtest" + test "$(ls -l $VAR_WWW/config.txt | cut -d' ' -f1-4)" == "-rw------- 1 ynhtest ynhtest" } ynhtest_simple_template_system_config() { @@ -35,7 +35,7 @@ EOF ynh_config_add --template="$template" --destination="/etc/cron.d/ynhtest_config" - test "$(cat $VAR_WWW/config.txt)" == "$(echo -ne 'app=ynhtest\nfoo=bar')" + test "$(cat /etc/cron.d/ynhtest_config)" == "$(echo -ne 'app=ynhtest\nfoo=bar')" test "$(ls -l /etc/cron.d/ynhtest_config | cut -d' ' -f1-4)" == "-r-------- 1 root root" rm -f /etc/cron.d/ynhtest_config @@ -53,11 +53,12 @@ app={{ app }} EOF foo="bar" + install_dir="$VAR_WWW" ynh_config_add --template="$template" --destination="$VAR_WWW/config.txt" --jinja test "$(cat $VAR_WWW/config.txt)" == "$(echo -ne 'app=ynhtest\nfoo=true')" - test "$(ls -l $VAR_WWW/config.txt | cut -d' ' -f1-4)" == "-rw-r----- 1 ynhtest ynhtest" + test "$(ls -l $VAR_WWW/config.txt | cut -d' ' -f1-4)" == "-rw------- 1 ynhtest ynhtest" }