Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Simplify a bit regression tests
Baptiste Daroussin committed 10 years ago
commit df928cd963f1d44b6c999296eece26995f0f4c8c
parent bcce406
19 files changed +3 -118
modified tests/frontend/001sanity.sh
@@ -1,10 +1,6 @@
#!/usr/bin/env atf-sh

atf_test_case which
-
which_head() {
-
	atf_set "descr" "test the sanity of the tested pkg location"
-
}
-

which_body() {
	atf_check \
	    -o inline:"$(atf_get_srcdir)/../../src/pkg\n" \
@@ -14,10 +10,6 @@ which_body() {
}

atf_test_case ldd
-
ldd_head() {
-
	atf_set "descr" "test the sanity of the ldd output"
-
}
-

ldd_body() {
	atf_check \
	    -o match:".*libpkg.so.3 => $(atf_get_srcdir).*$" \
@@ -25,6 +17,7 @@ ldd_body() {
	    -s exit:0 \
	    ldd -a $(atf_get_srcdir)/../../src/.libs/pkg
}
+

atf_init_test_cases() {
	. $(atf_get_srcdir)/test_environment.sh

modified tests/frontend/add.sh
@@ -36,10 +36,6 @@ EOF
}

atf_test_case add
-
add_head() {
-
	atf_set "descr" "pkg add"
-
}
-

add_body() {
	initialize_pkg

@@ -61,9 +57,6 @@ post-install
}

atf_test_case add_automatic
-
add_automatic_head() {
-
	atf_set "descr" "pkg add -A"
-
}
add_automatic_body() {
	initialize_pkg

@@ -100,17 +93,11 @@ ${JAILED}Extracting test-1: done
		pkg add -I test-1.txz
}
atf_test_case add_force
-
add_force_head() {
-
	atf_set "descr" "pkg add -f"
-
}
add_force_body() {
	initialize_pkg
}

atf_test_case add_accept_missing
-
add_accept_missing_head() {
-
	atf_set "descr" "pkg add -M"
-
}
add_accept_missing_body() {
	touch a
	cat << EOF > test.ucl
@@ -170,9 +157,6 @@ post-install
}

atf_test_case add_quiet
-
add_quiet_head() {
-
	atf_set "descr" "pkg add -q"
-
}
add_quiet_body() {
	initialize_pkg

@@ -183,9 +167,6 @@ add_quiet_body() {
}

atf_test_case add_stdin
-
add_stdin_head() {
-
	atf_set "descr" "pkg add -"
-
}
add_stdin_body() {
	initialize_pkg

modified tests/frontend/annotate.sh
@@ -2,7 +2,6 @@

atf_test_case annotate
annotate_head() {
-
	atf_set "descr" "pkg annotate"
	atf_set "require.files" \
	   "${RESOURCEDIR}/png.ucl ${RESOURCEDIR}/sqlite3.ucl"
}
modified tests/frontend/conflicts-multirepo.sh
@@ -1,7 +1,6 @@
#! /usr/bin/env atf-sh
atf_test_case conflicts_multirepo
conflicts_multirepo_head() {
-
	atf_set "descr" "Testing dynamic conflicts resolution in mutlirepo"
	atf_set "timeout" "20"
}

modified tests/frontend/conflicts.sh
@@ -1,9 +1,5 @@
#! /usr/bin/env atf-sh
atf_test_case find_conflicts
-
find_conflicts_head() {
-
	atf_set "descr" "Testing dynamic conflicts resolution"
-
}
-

find_conflicts_body() {
	touch a
	cat << EOF >> manifest
modified tests/frontend/create.sh
@@ -1,10 +1,5 @@
#! /usr/bin/env atf-sh

-
atf_test_case create_from_plist
-
create_from_plist_head() {
-
	atf_set "descr" "Testing pkg create from plist"
-
}
-

genmanifest() {
	cat << EOF >> +MANIFEST
name: test
@@ -40,6 +35,7 @@ basic_validation() {
	xz -t test-1.txz || atf_fail "XZ integrity check failed"
}

+
atf_test_case create_from_plist
create_from_plist_body() {
	touch file1
	genmanifest
@@ -60,10 +56,6 @@ create_from_plist_body() {
}

atf_test_case create_from_plist_set_owner
-
create_from_plist_set_owner_head() {
-
	atf_set "descr" "Testing credentials set from the plist"
-
}
-

create_from_plist_set_owner_body() {

	preparetestcredentials "(plop,,)"
modified tests/frontend/delete.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case simple_delete
-
simple_delete_head() {
-
	atf_set "descr" "Testing pkg delete"
-
}
-

simple_delete_body() {
	touch file1
	mkdir dir
@@ -47,10 +43,6 @@ EOF
}

atf_test_case simple_delete_prefix_ending_with_slash
-
simple_delete_prefix_ending_with_slash_head() {
-
	atf_set "descr" "Testing pkg delete when prefix end with /"
-
}
-

simple_delete_prefix_ending_with_slash_body() {
	touch file1
	mkdir dir
@@ -93,10 +85,6 @@ EOF
}

atf_test_case delete_with_directory_owned
-
delete_with_directory_owned_head() {
-
	atf_set "descr" "Testing pkg delete when a directory is owned by another package"
-
}
-

delete_with_directory_owned_body() {
	touch file1
	mkdir dir
modified tests/frontend/lock.sh
@@ -2,7 +2,6 @@

atf_test_case lock
lock_head() {
-
	atf_set "descr" "pkg lock"
	atf_set "require.files" \
	   "${RESOURCEDIR}/png.ucl ${RESOURCEDIR}/sqlite3.ucl"
}
modified tests/frontend/packagesplit.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case package_split
-
package_split_head() {
-
	atf_set "descr" "testing package splitting"
-
}
-

package_split_body() {
	touch file1
	touch file2
modified tests/frontend/php-pr.sh
@@ -1,11 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case pkg_phpextensions
-

-
pkg_phpextensions_head() {
-
	atf_set "descr" "testing pkg -- install php module wich dep on newer php version even with upgrade"
-
}
-

pkg_phpextensions_body() {
	touch php53.file
	touch php53extension.file
modified tests/frontend/pkg.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case pkg_no_database
-
pkg_no_database_head() {
-
	atf_set "descr" "testing pkg -- no database"
-
}
-

pkg_no_database_body() {
	atf_check \
	    -o empty \
@@ -14,11 +10,6 @@ pkg_no_database_body() {
}

atf_test_case pkg_config_defaults
-
pkg_config_defaults_head()
-
{
-
	atf_set "descr" "testing pkg -- compiled-in defaults"
-
}
-

pkg_config_defaults_body()
{
	atf_check \
@@ -51,12 +42,6 @@ pkg_config_defaults_body()
}

atf_test_case pkg_create_manifest_bad_syntax
-
pkg_create_manifest_bad_syntax_head()
-
{
-
	atf_set "descr" "Testing bad syntax in manifest"
-

-
}
-

pkg_create_manifest_bad_syntax_body()
{
	mkdir -p testpkg/.metadir
@@ -83,11 +68,6 @@ EOF
}

atf_test_case pkg_repo_load_order
-
pkg_repo_load_order_head()
-
{
-
	atf_set "descr" "Testing the order the repository configuration files are loaded"
-
}
-

pkg_repo_load_order_body()
{
	echo "03_repo: { url: file:///03_repo }" > plop.conf
modified tests/frontend/query.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case query
-
query_head() {
-
	atf_set "descr" "testing pkg query"
-
}
-

query_body() {
	touch plop
	touch bla
modified tests/frontend/register.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

-
atf_test_case register
-
register_conflicts_head() {
-
	atf_set "descr" "testing pkg register conflicts"
-
}
-

+
atf_test_case register_conflicts
register_conflicts_body() {
	mkdir -p teststage/${TMPDIR}
	echo a > teststage/${TMPDIR}/plop
modified tests/frontend/repo.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case repo
-
repo_head() {
-
	atf_set "descr" "testing pkg repo"
-
}
-

repo_body() {
	touch plop
	touch bla
modified tests/frontend/requires.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case requires
-
requires_head() {
-
	atf_set "descr" "Testings requires"
-
}
-

requires_body() {
	cat << EOF >> repo.conf
local1: {
modified tests/frontend/rootdir.sh
@@ -1,10 +1,6 @@
#!/usr/bin/env atf-sh

atf_test_case rootdir
-
rootdir_head() {
-
	atf_set "descr" "pkg -r <rootdir>"
-
}
-

rootdir_body() {
	unset PKG_DBDIR

modified tests/frontend/rubypuppet.sh
@@ -5,11 +5,6 @@


atf_test_case pkg_puppet
-

-
pkg_puppet_head() {
-
	atf_set "descr" "testing pkg -- ruby upgrade and puppet removal"
-
}
-

pkg_puppet_body() {
	touch puppet.file
	touch ruby.file
modified tests/frontend/search.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case search
-
search_head() {
-
	atf_set "descr" "testing pkg search"
-
}
-

search_body() {
	export REPOS_DIR=/nonexistent
	atf_check -e inline:"No active remote repositories configured.\n" -o empty -s exit:3 pkg -C '' -R '' search -e -Q comment -S name pkg
modified tests/frontend/version.sh
@@ -1,10 +1,6 @@
#! /usr/bin/env atf-sh

atf_test_case version
-
version_head() {
-
	atf_set "descr" "testing pkg version"
-
}
-

version_body() {
	atf_check -o inline:"<\n" -s exit:0 pkg version -t 1 2
	atf_check -o inline:">\n" -s exit:0 pkg version -t 2 1