summaryrefslogtreecommitdiff
path: root/test/libremakepkg-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-02-02 20:54:07 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-02-02 20:54:07 -0500
commitef7a330eae68da2f47c617502b28a2f8c9eeb792 (patch)
treef51373a47a19f8003069e16ead842b395a4b2b04 /test/libremakepkg-test.sh
parent804e5e1093c3aa8258bf9f8c97ff661cdf8407f1 (diff)
libremakepkg-test: test the -N flag
Diffstat (limited to 'test/libremakepkg-test.sh')
-rw-r--r--test/libremakepkg-test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh
index 7b64dc0..06cf695 100644
--- a/test/libremakepkg-test.sh
+++ b/test/libremakepkg-test.sh
@@ -33,6 +33,31 @@ it_builds_a_trivial_package() {
[[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]]
}
+
+it_disables_networking_during_build() {
+ require network sudo || return 0
+ cp libremakepkg.d/PKGBUILD-netbuild "$tmpdir/PKGBUILD"
+ cd "$tmpdir"
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ ! testsudo libremakepkg -l "$roundup_test_name"
+ ! [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]]
+ testsudo libremakepkg -l "$roundup_test_name" -N
+ [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]]
+}
+
+it_disables_networking_during_package() {
+ require network sudo || return 0
+ cp libremakepkg.d/PKGBUILD-netpackage "$tmpdir/PKGBUILD"
+ cd "$tmpdir"
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ ! testsudo libremakepkg -l "$roundup_test_name"
+ ! [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]]
+ testsudo libremakepkg -l "$roundup_test_name" -N
+ [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]]
+}
+
it_cleans_the_chroot_before_building() {
require network sudo || return 0
# 1. First, we build testpkg1