From 18f172e80ca891d95724e1e9b18755b69e3fe783 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 25 Jan 2019 07:20:16 -0500 Subject: [PATCH] [unpackfs] Add tests - Add global- and job-configurations for test runs. - Add a driver script that sets up some assumptions on the host system so that the tests can complete. - The idea is that these tests together get a decent code-coverage for the module. --- src/modules/unpackfs/runtests.sh | 17 +++++++++++++++++ src/modules/unpackfs/tests/1.global | 2 ++ src/modules/unpackfs/tests/2.global | 2 ++ src/modules/unpackfs/tests/3.global | 2 ++ src/modules/unpackfs/tests/3.job | 2 ++ src/modules/unpackfs/tests/4.global | 2 ++ src/modules/unpackfs/tests/4.job | 4 ++++ src/modules/unpackfs/tests/5.global | 2 ++ src/modules/unpackfs/tests/5.job | 5 +++++ src/modules/unpackfs/tests/6.global | 2 ++ src/modules/unpackfs/tests/6.job | 5 +++++ src/modules/unpackfs/tests/7.global | 2 ++ src/modules/unpackfs/tests/7.job | 5 +++++ 13 files changed, 52 insertions(+) create mode 100644 src/modules/unpackfs/runtests.sh create mode 100644 src/modules/unpackfs/tests/1.global create mode 100644 src/modules/unpackfs/tests/2.global create mode 100644 src/modules/unpackfs/tests/3.global create mode 100644 src/modules/unpackfs/tests/3.job create mode 100644 src/modules/unpackfs/tests/4.global create mode 100644 src/modules/unpackfs/tests/4.job create mode 100644 src/modules/unpackfs/tests/5.global create mode 100644 src/modules/unpackfs/tests/5.job create mode 100644 src/modules/unpackfs/tests/6.global create mode 100644 src/modules/unpackfs/tests/6.job create mode 100644 src/modules/unpackfs/tests/7.global create mode 100644 src/modules/unpackfs/tests/7.job diff --git a/src/modules/unpackfs/runtests.sh b/src/modules/unpackfs/runtests.sh new file mode 100644 index 000000000..2b9b704c0 --- /dev/null +++ b/src/modules/unpackfs/runtests.sh @@ -0,0 +1,17 @@ +#! /bin/sh +SRCDIR=$( dirname "$0" ) + +# For test 3 +mkdir /tmp/unpackfs-test-run-rootdir3 + +# For test 7 +mkdir /tmp/unpackfs-test-run-rootdir3/realdest + +# Run tests +sh "$SRCDIR/../testpythonrun.sh" unpackfs + +# Cleanup test 7 +rm -rf /tmp/unpackfs-test-run-rootdir3/realdest + +# Cleanup test 3 +rmdir /tmp/unpackfs-test-run-rootdir3 diff --git a/src/modules/unpackfs/tests/1.global b/src/modules/unpackfs/tests/1.global new file mode 100644 index 000000000..02ae840cb --- /dev/null +++ b/src/modules/unpackfs/tests/1.global @@ -0,0 +1,2 @@ +--- +bogus: true diff --git a/src/modules/unpackfs/tests/2.global b/src/modules/unpackfs/tests/2.global new file mode 100644 index 000000000..f496ade61 --- /dev/null +++ b/src/modules/unpackfs/tests/2.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir/ diff --git a/src/modules/unpackfs/tests/3.global b/src/modules/unpackfs/tests/3.global new file mode 100644 index 000000000..2e6b37ab5 --- /dev/null +++ b/src/modules/unpackfs/tests/3.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ diff --git a/src/modules/unpackfs/tests/3.job b/src/modules/unpackfs/tests/3.job new file mode 100644 index 000000000..429f65b3c --- /dev/null +++ b/src/modules/unpackfs/tests/3.job @@ -0,0 +1,2 @@ +--- +unpack: [] diff --git a/src/modules/unpackfs/tests/4.global b/src/modules/unpackfs/tests/4.global new file mode 100644 index 000000000..2e6b37ab5 --- /dev/null +++ b/src/modules/unpackfs/tests/4.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ diff --git a/src/modules/unpackfs/tests/4.job b/src/modules/unpackfs/tests/4.job new file mode 100644 index 000000000..ab76dcbeb --- /dev/null +++ b/src/modules/unpackfs/tests/4.job @@ -0,0 +1,4 @@ +--- +unpack: + - source: . + sourcefs: bogus diff --git a/src/modules/unpackfs/tests/5.global b/src/modules/unpackfs/tests/5.global new file mode 100644 index 000000000..2e6b37ab5 --- /dev/null +++ b/src/modules/unpackfs/tests/5.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ diff --git a/src/modules/unpackfs/tests/5.job b/src/modules/unpackfs/tests/5.job new file mode 100644 index 000000000..2f8d732d0 --- /dev/null +++ b/src/modules/unpackfs/tests/5.job @@ -0,0 +1,5 @@ +--- +unpack: + - source: ./fakesource + sourcefs: ext4 + destination: fakedest diff --git a/src/modules/unpackfs/tests/6.global b/src/modules/unpackfs/tests/6.global new file mode 100644 index 000000000..2e6b37ab5 --- /dev/null +++ b/src/modules/unpackfs/tests/6.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ diff --git a/src/modules/unpackfs/tests/6.job b/src/modules/unpackfs/tests/6.job new file mode 100644 index 000000000..c1110a106 --- /dev/null +++ b/src/modules/unpackfs/tests/6.job @@ -0,0 +1,5 @@ +--- +unpack: + - source: . + sourcefs: ext4 + destination: fakedest diff --git a/src/modules/unpackfs/tests/7.global b/src/modules/unpackfs/tests/7.global new file mode 100644 index 000000000..2e6b37ab5 --- /dev/null +++ b/src/modules/unpackfs/tests/7.global @@ -0,0 +1,2 @@ +--- +rootMountPoint: /tmp/unpackfs-test-run-rootdir3/ diff --git a/src/modules/unpackfs/tests/7.job b/src/modules/unpackfs/tests/7.job new file mode 100644 index 000000000..a31068e5d --- /dev/null +++ b/src/modules/unpackfs/tests/7.job @@ -0,0 +1,5 @@ +--- +unpack: + - source: . + sourcefs: ext4 + destination: realdest