Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Don't know why but on linux the testsuite names pkg lt-pkg for err(3)/warn(3)... so be it
Baptiste Daroussin committed 9 years ago
commit 5dd1e97b15184ddb2add9dab55a87f10ce18f047
parent dfb467e
8 files changed +24 -19
modified tests/frontend/add.sh
@@ -147,7 +147,7 @@ EOF

	atf_check \
		-o inline:"${JAILED}Installing test-1...\n\nFailed to install the following 1 package(s): test-1.txz\n" \
-
		-e inline:"pkg: Missing dependency 'b'\n" \
+
		-e inline:"${PROGNAME}: Missing dependency 'b'\n" \
		-s exit:70 \
		pkg add test-1.txz

@@ -158,7 +158,7 @@ post-install
"
	atf_check \
		-o inline:"${OUTPUT}" \
-
		-e inline:"pkg: Missing dependency 'b'\n" \
+
		-e inline:"${PROGNAME}: Missing dependency 'b'\n" \
		-s exit:0 \
		pkg add -M test-1.txz
}
@@ -228,7 +228,7 @@ EOF

	cat test-1.txz | atf_check \
		-o inline:"${JAILED}Installing test-1...\n\nFailed to install the following 1 package(s): -\n" \
-
		-e inline:"pkg: Missing dependency 'b'\n" \
+
		-e inline:"${PROGNAME}: Missing dependency 'b'\n" \
		-s exit:70 \
		pkg add -

@@ -239,7 +239,7 @@ post-install
"
	cat test-1.txz | atf_check \
		-o inline:"${OUTPUT}" \
-
		-e inline:"pkg: Missing dependency 'b'\n" \
+
		-e inline:"${PROGNAME}: Missing dependency 'b'\n" \
		-s exit:0 \
		pkg add -M -
}
modified tests/frontend/alias.sh
@@ -24,7 +24,7 @@ alias_body() {

	atf_check \
		-o empty \
-
		-e inline:"pkg: No such alias: 'nonexistent'\n" \
+
		-e inline:"${PROGNAME}: No such alias: 'nonexistent'\n" \
		-s exit:69 \
		pkg -C "" alias nonexistent
}
@@ -56,7 +56,7 @@ list 'info -q'

	atf_check \
		-o empty \
-
		-e inline:"pkg: No such alias: 'nonexistent'\n" \
+
		-e inline:"${PROGNAME}: No such alias: 'nonexistent'\n" \
		-s exit:69 \
		pkg -C "" alias nonexistent
}
@@ -95,7 +95,7 @@ list 'info -q'

	atf_check \
		-o empty \
-
		-e inline:"pkg: No such alias: 'nonexistent'\n" \
+
		-e inline:"${PROGNAME}: No such alias: 'nonexistent'\n" \
		-s exit:69 \
		pkg -C config alias nonexistent
}
modified tests/frontend/config.sh
@@ -62,6 +62,6 @@ nameserver_body()

	atf_check \
		-o inline:"plop\n" \
-
		-e inline:"pkg: Unable to set nameserver, ignoring\n" \
+
		-e inline:"${PROGNAME}: Unable to set nameserver, ignoring\n" \
		pkg -o NAMESERVER="plop" -C /dev/null config nameserver
}
modified tests/frontend/create.sh
@@ -180,7 +180,7 @@ create_from_plist_dirrm_body() {

		atf_check \
			-o empty \
-
			-e inline:"pkg: Warning: @dirrm[try] is deprecated, please use @dir\n" \
+
			-e inline:"${PROGNAME}: Warning: @dirrm[try] is deprecated, please use @dir\n" \
			pkg -o DEVELOPER_MODE=yes create -o ${TMPDIR} -m . -p test.plist -r .
	done
}
@@ -204,7 +204,7 @@ aline"

	atf_check \
		-o empty \
-
		-e inline:"pkg: Warning: @ignore is deprecated\n" \
+
		-e inline:"${PROGNAME}: Warning: @ignore is deprecated\n" \
		pkg -o DEVELOPER_MODE=yes create -o ${TMPDIR} -m . -p test.plist -r .
}

@@ -225,7 +225,7 @@ create_from_plist_bad_fflags_body() {

	atf_check \
		-o empty \
-
		-e inline:"pkg: Malformed keyword '', wrong fflags\n" \
+
		-e inline:"${PROGNAME}: Malformed keyword '', wrong fflags\n" \
		-s exit:70 \
		pkg create -o ${TMPDIR} -m . -p test.plist -r .
}
@@ -235,7 +235,7 @@ create_from_plist_with_keyword_arguments_body() {

	atf_check \
		-o empty \
-
		-e inline:"pkg: cannot parse keyword: cannot open file ./testkeyword.ucl: No such file or directory\npkg: unknown keyword testkeyword: @testkeyword\n" \
+
		-e inline:"${PROGNAME}: cannot parse keyword: cannot open file ./testkeyword.ucl: No such file or directory\n${PROGNAME}: unknown keyword testkeyword: @testkeyword\n" \
		-s exit:70 \
		pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .

@@ -248,7 +248,7 @@ EOF

	atf_check \
		-o empty \
-
		-e inline:"pkg: Requesting argument %2 while only 1 arguments are available\n" \
+
		-e inline:"${PROGNAME}: Requesting argument %2 while only 1 arguments are available\n" \
		-s exit:70 \
		pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .

@@ -263,7 +263,7 @@ EOF

	atf_check \
		-o empty \
-
		-e inline:"pkg: Invalid argument: expecting a number got (%1)\n" \
+
		-e inline:"${PROGNAME}: Invalid argument: expecting a number got (%1)\n" \
		-s exit:70 \
		pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .

modified tests/frontend/install.sh
@@ -120,7 +120,7 @@ EOF
		pkg create -M test.ucl

	atf_check -o ignore \
-
		-e inline:"pkg: PRE-INSTALL script failed\n" \
+
		-e inline:"${PROGNAME}: PRE-INSTALL script failed\n" \
		-s exit:3 \
		pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.txz
}
@@ -141,7 +141,7 @@ EOF
		pkg create -M test.ucl

	atf_check -o ignore \
-
		-e inline:"pkg: POST-INSTALL script failed\n" \
+
		-e inline:"${PROGNAME}: POST-INSTALL script failed\n" \
		-s exit:0 \
		pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.txz
}
modified tests/frontend/pkg.sh
@@ -11,7 +11,7 @@ tests_init \
pkg_no_database_body() {
	atf_check \
	    -o empty \
-
	    -e inline:"pkg: package database non-existent\n" \
+
	    -e inline:"${PROGNAME}: package database non-existent\n" \
	    -s exit:69 \
	    env -i PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" pkg -o PKG_DBDIR=/dev/null -N
}
@@ -67,7 +67,7 @@ files:
EOF
	atf_check \
	    -o empty \
-
	    -e inline:"pkg: Bad format in manifest for key: files\n" \
+
	    -e inline:"${PROGNAME}: Bad format in manifest for key: files\n" \
	    -s exit:70 \
	    pkg create -q -m testpkg/.metadir -r testpkg
}
modified tests/frontend/test_environment.sh.in
@@ -10,6 +10,11 @@ jailed=$(sysctl -n security.jail.jailed 2>/dev/null || :)
if [ "$jailed" = "1" ]; then
	export JAILED="[`hostname`] "
fi
+
if [ "${OS}" = "Linux" ]; then
+
	export PROGNAME="lt-pkg"
+
else
+
	export PROGNAME="pkg"
+
fi

tests_init()
{
modified tests/frontend/vital.sh
@@ -40,7 +40,7 @@ EOF

	atf_check \
		-o empty \
-
		-e inline:"pkg: Cannot delete vital pkg: test!\n" \
+
		-e inline:"${PROGNAME}: Cannot delete vital ${PROGNAME}: test!\n" \
		-s exit:3 \
		pkg -r ${TMPDIR}/target delete -qy test
	atf_check \