From ef7a330eae68da2f47c617502b28a2f8c9eeb792 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 20:54:07 -0500 Subject: libremakepkg-test: test the -N flag --- test/libremakepkg-test.sh | 25 +++++++++++++++++++++++++ test/libremakepkg.d/PKGBUILD-netbuild | 16 ++++++++++++++++ test/libremakepkg.d/PKGBUILD-netpackage | 12 ++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 test/libremakepkg.d/PKGBUILD-netbuild create mode 100644 test/libremakepkg.d/PKGBUILD-netpackage (limited to 'test') 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 diff --git a/test/libremakepkg.d/PKGBUILD-netbuild b/test/libremakepkg.d/PKGBUILD-netbuild new file mode 100644 index 0000000..c1335a6 --- /dev/null +++ b/test/libremakepkg.d/PKGBUILD-netbuild @@ -0,0 +1,16 @@ +pkgname='libretools-netbuild' +pkgver=1.0 +license=('GPL') +url='https://parabolagnulinux.org' + +pkgrel=1 +arch=(any) + +build() { + curl https://repo.parabolagnulinux.org/ > index.html +} + +package() { + cd "$srcdir" + install -Dm644 index.html "$pkgdir"/usr/share/$pkgname/index.html +} diff --git a/test/libremakepkg.d/PKGBUILD-netpackage b/test/libremakepkg.d/PKGBUILD-netpackage new file mode 100644 index 0000000..cbefe8f --- /dev/null +++ b/test/libremakepkg.d/PKGBUILD-netpackage @@ -0,0 +1,12 @@ +pkgname='libretools-netpackage' +pkgver=1.0 +license=('GPL') +url='https://parabolagnulinux.org' + +pkgrel=1 +arch=(any) + +package() { + install -d "$pkgdir"/usr/share/$pkgname + curl https://repo.parabolagnulinux.org/ > "$pkgdir"/usr/share/$pkgname/index.html +} -- cgit v1.2.2