aboutsummaryrefslogtreecommitdiff
path: root/devel/ice
diff options
context:
space:
mode:
authorMichael Gmelin <grembo@FreeBSD.org>2015-09-22 15:02:59 +0000
committerMichael Gmelin <grembo@FreeBSD.org>2015-09-22 15:02:59 +0000
commit5ec03e959472559e58e597a6286af9e28a153a75 (patch)
treee28b9b4d632e080ad8c26b6cd6c1f29028d33c11 /devel/ice
parent144418ecce2ce22bab2d85db2733e94ef2662fdd (diff)
downloadports-5ec03e959472559e58e597a6286af9e28a153a75.tar.gz
ports-5ec03e959472559e58e597a6286af9e28a153a75.zip
Fix unit test in case hostname is not on a local interface
PR: 201743 Approved by: mentors (implicit)
Notes
Notes: svn path=/head/; revision=397542
Diffstat (limited to 'devel/ice')
-rw-r--r--devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py b/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py
new file mode 100644
index 000000000000..da0b3013acf2
--- /dev/null
+++ b/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py
@@ -0,0 +1,38 @@
+--- cpp/test/Glacier2/staticFiltering/run.py.orig 2015-06-23 17:30:20.000000000 +0200
++++ cpp/test/Glacier2/staticFiltering/run.py 2015-09-22 16:23:30.270288987 +0200
+@@ -8,7 +8,7 @@
+ #
+ # **********************************************************************
+
+-import os, sys, time, socket
++import os, sys, time, socket, subprocess
+
+ path = [ ".", "..", "../..", "../../..", "../../../.." ]
+ head = os.path.dirname(sys.argv[0])
+@@ -99,12 +99,26 @@
+ hostname = "127.0.0.1"
+ fqdn = ""
+ domainname = ""
++
++ # Check if IP addresses are configured on a local interface
++ if TestUtil.isFreeBSD():
++ p = subprocess.Popen("ifconfig", shell=1, stdout=subprocess.PIPE)
++ r = p.communicate()[0]
++ if r.find("inet " + testaddr1) == -1 or r.find("inet " + testaddr2) == 1:
++ print("Warning: Not all host IP addresses are available")
++ limitedTests = True
++ hostname = "127.0.0.1"
++ fqdn = ""
++ domainname = ""
+ except:
+ limitedTests = True
+ hostname = "127.0.0.1"
+ fqdn = ""
+ domainname = ""
+
++if limitedTests:
++ print("Running limited tests")
++
+ testcases = [
+ ('testing category filter',
+ ('', '', '', 'foo "a cat with spaces"', '', ''),