summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-27 06:01:31 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-27 06:01:31 (EDT)
commitb1e208d0a180a4f8d7a721511f2ad343164bce5f (patch)
tree590c91da8e811fdd2f99b792c1f4ec486fffefb3 /tests
parentcf28ddd05f2c9a97e1836b551276e4a74f06b1d5 (diff)
Add unit tests for oh-installfiles.
Diffstat (limited to 'tests')
-rw-r--r--tests/t_installfiles_dir17
-rw-r--r--tests/t_installfiles_dir_slash17
-rw-r--r--tests/t_installfiles_patterns_and_links25
3 files changed, 59 insertions, 0 deletions
diff --git a/tests/t_installfiles_dir b/tests/t_installfiles_dir
new file mode 100644
index 0000000..e112e3a
--- /dev/null
+++ b/tests/t_installfiles_dir
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+mkdir foo.pkg
+cat >foo.pkg/files <<-EOF
+ /usr/bin
+ EOF
+
+mkdir -p tmp/dest/usr/bin
+>tmp/dest/usr/bin/foo
+
+cd tmp
+OPK_PACKAGES='foo' oh-installfiles
+assert test_non_dir_nodes dest
+assert test_nodes foo.data / /usr/ /usr/bin/ /usr/bin/foo
+cd ..
+
+rm -Rf foo.pkg tmp
diff --git a/tests/t_installfiles_dir_slash b/tests/t_installfiles_dir_slash
new file mode 100644
index 0000000..be4ae42
--- /dev/null
+++ b/tests/t_installfiles_dir_slash
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+mkdir foo.pkg
+cat >foo.pkg/files <<-EOF
+ /usr/bin/
+ EOF
+
+mkdir -p tmp/dest/usr/bin
+>tmp/dest/usr/bin/foo
+
+cd tmp
+OPK_PACKAGES='foo' oh-installfiles
+assert test_non_dir_nodes dest
+assert test_nodes foo.data / /usr/ /usr/bin/ /usr/bin/foo
+cd ..
+
+rm -Rf foo.pkg tmp
diff --git a/tests/t_installfiles_patterns_and_links b/tests/t_installfiles_patterns_and_links
new file mode 100644
index 0000000..7fdfa2d
--- /dev/null
+++ b/tests/t_installfiles_patterns_and_links
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+mkdir libfoo.1.pkg libfoo-dev.pkg
+cat >libfoo.1.pkg/files <<-EOF
+ /usr/lib/*/libfoo.so.*
+ EOF
+cat >libfoo-dev.pkg/files <<-EOF
+ /usr/lib/*/libfoo.so
+ EOF
+
+mkdir -p tmp/dest/usr/lib/arch
+>tmp/dest/usr/lib/arch/libfoo.so.1.0.0
+ln -sf libfoo.so.1.0.0 tmp/dest/usr/lib/arch/libfoo.so.1
+ln -sf libfoo.so.1 tmp/dest/usr/lib/arch/libfoo.so
+
+cd tmp
+OPK_PACKAGES='foo libfoo.1 libfoo-dev' oh-installfiles
+assert test_non_dir_nodes dest
+assert test_nodes libfoo.1.data / /usr/ /usr/lib/ /usr/lib/arch/ \
+ /usr/lib/arch/libfoo.so.1.0.0 /usr/lib/arch/libfoo.so.1@
+assert test_nodes libfoo-dev.data / /usr/ /usr/lib/ /usr/lib/arch/ \
+ /usr/lib/arch/libfoo.so@
+cd ..
+
+rm -Rf foo.pkg libfoo.1.pkg libfoo-dev.pkg tmp