Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2016-01-18 22:13:12 +0100
committerArthur de Jong <arthur@arthurdejong.org>2016-01-20 23:05:08 +0100
commit525c996c534ee68dc5ff26a11c7863a1e0c27c88 (patch)
tree6a3227b8c12b0abc181eb74a914b38908608b37d /tests
parent31cd2cf4dc588f2a11c8223ef9e1962c849466eb (diff)
Add a few IPv6 tests
This adds a few test hosts that have IPv6 addresses. This ensures that we have an IPv6-only host and hosts which have address values in different order in the ipHostNumber attribute (although attribute order is probably not guaranteed).
Diffstat (limited to 'tests')
-rw-r--r--tests/test.ldif18
-rwxr-xr-xtests/test_nsscmds.sh36
2 files changed, 52 insertions, 2 deletions
diff --git a/tests/test.ldif b/tests/test.ldif
index d032b22..08985a2 100644
--- a/tests/test.ldif
+++ b/tests/test.ldif
@@ -40181,8 +40181,26 @@ dn: cn=testhost2,ou=hosts,dc=test,dc=tld
objectClass: top
objectClass: ieee802Device
objectClass: device
+objectClass: ipHost
cn: testhost2
macAddress: 0:18:8a:54:1a:8b
+ipHostNumber: 192.0.2.124
+ipHostNumber: 2001:db8::dead:beef
+
+dn: cn=testhost3,ou=hosts,dc=test,dc=tld
+objectClass: top
+objectClass: device
+objectClass: ipHost
+cn: testhost3
+ipHostNumber: 2001:db8::feed:c0de
+
+dn: cn=testhost4,ou=hosts,dc=test,dc=tld
+objectClass: top
+objectClass: device
+objectClass: ipHost
+cn: testhost4
+ipHostNumber: 2001:db8::7e27:ac1d
+ipHostNumber: 192.0.2.126
dn: ou=networks,dc=test,dc=tld
objectClass: top
diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh
index 5cd54c3..7c8056a 100755
--- a/tests/test_nsscmds.sh
+++ b/tests/test_nsscmds.sh
@@ -245,11 +245,43 @@ check "getent hosts 192.0.2.123" << EOM
192.0.2.123 testhost testhostalias
EOM
-check "getent hosts | grep testhost" << EOM
+check "getent hosts | grep testhost | sort" << EOM
192.0.2.123 testhost testhostalias
+192.0.2.124 testhost2
+192.0.2.126 testhost4
EOM
-# TODO: add more tests for IPv6 support
+check "getent hosts 2001:db8::dead:beef" << EOM
+2001:db8::dead:beef testhost2
+EOM
+
+check "getent ahosts testhost2" << EOM
+2001:db8::dead:beef STREAM testhost2
+2001:db8::dead:beef DGRAM
+2001:db8::dead:beef RAW
+192.0.2.124 STREAM
+192.0.2.124 DGRAM
+192.0.2.124 RAW
+EOM
+
+check "getent hosts testhost3" << EOM
+2001:db8::feed:c0de testhost3
+EOM
+
+check "getent ahosts testhost3" << EOM
+2001:db8::feed:c0de STREAM testhost3
+2001:db8::feed:c0de DGRAM
+2001:db8::feed:c0de RAW
+EOM
+
+check "getent ahosts testhost4" << EOM
+2001:db8::7e27:ac1d STREAM testhost4
+2001:db8::7e27:ac1d DGRAM
+2001:db8::7e27:ac1d RAW
+192.0.2.126 STREAM
+192.0.2.126 DGRAM
+192.0.2.126 RAW
+EOM
fi # end of hosts tests