summaryrefslogtreecommitdiffstats
path: root/pw/tests/helper_functions.shin
diff options
context:
space:
mode:
Diffstat (limited to 'pw/tests/helper_functions.shin')
-rwxr-xr-xpw/tests/helper_functions.shin15
1 files changed, 15 insertions, 0 deletions
diff --git a/pw/tests/helper_functions.shin b/pw/tests/helper_functions.shin
new file mode 100755
index 0000000..f87b1e7
--- /dev/null
+++ b/pw/tests/helper_functions.shin
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+# Workdir to run tests in
+TESTDIR=$(atf_get_srcdir)
+
+# Populate the files pw needs to use into $HOME/etc
+populate_etc_skel() {
+ cp ${TESTDIR}/master.passwd ${HOME} || \
+ atf_fail "Populating master.passwd in ${HOME}"
+ cp ${TESTDIR}/group ${HOME} || atf_fail "Populating group in ${HOME}"
+
+ # Generate the passwd file
+ pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \
+ atf_fail "generate passwd from master.passwd"
+}