From 6d9c68964d6478827b2545403f4c61b1dd74d5f7 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Tue, 10 Nov 2020 18:42:49 -0800
Subject: [PATCH 21/29] tests/profiles.scm: Disable tests using bootstrap
 binaries when networking is unavailable.

---
 tests/profiles.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: guix-debian/tests/profiles.scm
===================================================================
--- guix-debian.orig/tests/profiles.scm
+++ guix-debian/tests/profiles.scm
@@ -271,6 +271,7 @@
                                   (manifest-pattern (name name))))
            '("gcc" "binutils" "glibc" "coreutils" "grep" "sed"))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "profile-derivation"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))
@@ -371,6 +372,7 @@
                   (equal? (list (string-append "PATH=" bindir))
                           (environ)))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "<profile>"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))
@@ -382,6 +384,7 @@
        (_          (built-derivations (list drv))))
     (return (file-exists? (string-append bindir "/guile")))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "profile-derivation relative symlinks, one entry"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))
@@ -473,6 +476,7 @@
              (package->manifest-entry packages:glibc))
             "out")))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "profile-manifest, search-paths"
   (mlet* %store-monad
       ((guile ->   (package
@@ -536,6 +540,7 @@
                    (map manifest-entry-parent dependencies))
             (not (force (manifest-entry-parent entry))))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "read-manifest"
   (mlet* %store-monad ((manifest -> (packages->manifest
                                      (list (package
@@ -655,6 +660,7 @@
                                        (package-name %bootstrap-guile))
                              (eq? dep0 dep1))))))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "no collision"
   ;; Here we have an entry that is "lowered" (its 'item' field is a store file
   ;; name) and another entry (its 'item' field is a package) that is
@@ -673,6 +679,7 @@
                        (drv (profile-derivation manifest)))
     (return (->bool drv))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "etc/profile"
   ;; Make sure we get an 'etc/profile' file that at least defines $PATH.
   (mlet* %store-monad
@@ -699,6 +706,7 @@
          (and (zero? (close-pipe pipe))
               (string-contains path (string-append profile "/bin"))))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "etc/profile when etc/ already exists"
   ;; Here 'union-build' makes the profile's etc/ a symlink to the package's
   ;; etc/ directory, which makes it read-only.  Make sure the profile build
@@ -729,6 +737,7 @@
                                get-string-all)
                              "foo!"))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "etc/profile when etc/ is a symlink"
   ;; When etc/ is a symlink, the unsymlink code in 0.8.2 would fail
   ;; gracelessly because 'scandir' would return #f.
@@ -759,6 +768,7 @@
                                get-string-all)
                              "foo!"))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-assertm "profile-derivation when etc/ is a relative symlink"
   ;; See <https://bugs.gnu.org/32686>.
   (mlet* %store-monad
@@ -794,6 +804,7 @@
                           get-string-all)
                         "Heya!")))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-equalm "union vs. dangling symlink"        ;<https://bugs.gnu.org/26949>
   "does-not-exist"
   (mlet* %store-monad
@@ -817,6 +828,7 @@
       (built-derivations (list drv))
       (return (readlink (readlink (string-append profile "/dangling")))))))
 
+(unless (network-reachable?) (test-skip 1))
 (test-equalm "profile in profile"
   '("foo" "0")
 
