Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Mar 1, 2023
1 parent b14da2a commit 6e5479f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/frontend/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tests_init \
metalog \
reinstall \
pre_script_fail \
post_script_ignored \
post_script_fail \
install_missing_dep

test_setup()
Expand Down Expand Up @@ -150,7 +150,7 @@ EOF
pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.pkg
}

post_script_ignored_body()
post_script_fail_body()
{
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg test test 1
cat << EOF >> test.ucl
Expand All @@ -167,7 +167,7 @@ EOF

atf_check -o ignore \
-e inline:"${PROGNAME}: POST-INSTALL script failed\n" \
-s exit:0 \
-s exit:r \
pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.pkg
}

Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/lua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pkg: lua script failed\n"
mkdir -p ${TMPDIR}/target
atf_check \
-e inline:"${ERR}" \
-s exit:0 \
-s exit:3 \
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
}

Expand Down
6 changes: 3 additions & 3 deletions tests/lib/lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ ATF_TC_BODY(override, tc)
}
exit(lua_tonumber(L, -1));
}
atf_utils_wait(p, 0, "[string \"os.execute(\"/usr/bin/true\")\"]:1: os.execute not available\n", "");
atf_utils_wait(p, 1, "[string \"os.execute(\"/usr/bin/true\")\"]:1: os.execute not available\n", "");

p = atf_utils_fork();
if (p == 0) {
Expand All @@ -310,7 +310,7 @@ ATF_TC_BODY(override, tc)
}
exit(lua_tonumber(L, -1));
}
atf_utils_wait(p, 0, "[string \"os.exit(1)\"]:1: os.exit not available\n", "");
atf_utils_wait(p, 1, "[string \"os.exit(1)\"]:1: os.exit not available\n", "");

int rootfd = open(getcwd(NULL, 0), O_DIRECTORY);
lua_pushinteger(L, rootfd);
Expand Down Expand Up @@ -342,7 +342,7 @@ ATF_TC_BODY(override, tc)
}
exit(lua_tonumber(L, -1));
}
atf_utils_wait(p, 0, "[string \"os.remove(\"/bob\")...\"]:2: /bob: No such file or directory\n", "");
atf_utils_wait(p, 1, "[string \"os.remove(\"/bob\")...\"]:2: /bob: No such file or directory\n", "");
}

ATF_TC_BODY(fileops, tc)
Expand Down

0 comments on commit 6e5479f

Please sign in to comment.