From 77a06476dcca6cbf15ba55cefb11257a5a315338 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Fri, 25 Jul 2008 10:18:23 +0000 Subject: adapted UML scenarios to improved virtual IP address pool --- testing/hosts/default/etc/ipsec.d/tables.sql | 6 +-- testing/tests/ikev2/ip-pool-db/evaltest.dat | 2 +- testing/tests/sql/ip-pool-db-expired/evaltest.dat | 4 +- .../hosts/moon/etc/ipsec.d/data.sql | 52 +++++++++++++++++++--- testing/tests/sql/ip-pool-db-restart/evaltest.dat | 4 +- .../hosts/moon/etc/ipsec.d/data.sql | 44 ++++++++++++++++-- testing/tests/sql/ip-pool-db/evaltest.dat | 4 +- .../sql/ip-pool-db/hosts/moon/etc/ipsec.d/data.sql | 40 ++++++++++++++++- 8 files changed, 135 insertions(+), 21 deletions(-) (limited to 'testing') diff --git a/testing/hosts/default/etc/ipsec.d/tables.sql b/testing/hosts/default/etc/ipsec.d/tables.sql index 726c66e09..269709542 100644 --- a/testing/hosts/default/etc/ipsec.d/tables.sql +++ b/testing/hosts/default/etc/ipsec.d/tables.sql @@ -157,9 +157,9 @@ CREATE TABLE addresses ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, pool INTEGER NOT NULL, address BLOB NOT NULL, - identity INTEGER NOT NULL, - acquired INTEGER NOT NULL, - released INTEGER NOT NULL + identity INTEGER NOT NULL DEFAULT 0, + acquired INTEGER NOT NULL DEFAULT 0, + released INTEGER NOT NULL DEFAULT 1 ); DROP INDEX IF EXISTS addresses_pool; CREATE INDEX addresses_pool ON addresses ( diff --git a/testing/tests/ikev2/ip-pool-db/evaltest.dat b/testing/tests/ikev2/ip-pool-db/evaltest.dat index 07d17b338..d12e10959 100644 --- a/testing/tests/ikev2/ip-pool-db/evaltest.dat +++ b/testing/tests/ikev2/ip-pool-db/evaltest.dat @@ -9,7 +9,7 @@ dave::ip route list table 220::10.1.0.0/16.*src PH_IP_DAVE1::YES dave::ipsec status::home.*INSTALLED::YES dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES moon::cat /var/log/daemon.log::peer requested virtual IP %any::YES -moon::cat /var/log/daemon.log::assigning lease with new address from pool.*bigpool::YES +moon::cat /var/log/daemon.log::acquired new lease for address.*in pool.*bigpool::YES moon::cat /var/log/daemon.log::assigning virtual IP::YES moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.255.254.*static.*2::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.1,id=carol@strongswan.org::online::YES diff --git a/testing/tests/sql/ip-pool-db-expired/evaltest.dat b/testing/tests/sql/ip-pool-db-expired/evaltest.dat index 5d9d9441a..91dd9dff6 100644 --- a/testing/tests/sql/ip-pool-db-expired/evaltest.dat +++ b/testing/tests/sql/ip-pool-db-expired/evaltest.dat @@ -9,9 +9,9 @@ dave::ip route list table 220::10.1.0.0/16.*src PH_IP_DAVE1::YES dave::ipsec status::home.*INSTALLED::YES dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES moon::cat /var/log/daemon.log::peer requested virtual IP %any::YES -moon::cat /var/log/daemon.log::reassigning address from expired lease from pool.*bigpool::YES +moon::cat /var/log/daemon.log::acquired new lease for address.*in pool.*bigpool::YES moon::cat /var/log/daemon.log::assigning virtual IP::YES -moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.255.254.*1h.*2::YES +moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.0.6.*1h.*2::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.1,id=carol@strongswan.org::online::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.2,id=dave@strongswan.org::online::YES moon::ipsec status::rw.*ESTABLISHED.*carol@strongswan.org::YES diff --git a/testing/tests/sql/ip-pool-db-expired/hosts/moon/etc/ipsec.d/data.sql b/testing/tests/sql/ip-pool-db-expired/hosts/moon/etc/ipsec.d/data.sql index 8671f3070..83c2353f6 100644 --- a/testing/tests/sql/ip-pool-db-expired/hosts/moon/etc/ipsec.d/data.sql +++ b/testing/tests/sql/ip-pool-db-expired/hosts/moon/etc/ipsec.d/data.sql @@ -42,6 +42,12 @@ INSERT INTO identities ( 3, X'64617665407374726f6e677377616e2e6f7267' ); +INSERT INTO identities ( + type, data +) VALUES ( /* alice@strongswan.org */ + 3, X'616c696365407374726f6e677377616e2e6f7267' + ); + /* Certificates */ INSERT INTO certificates ( @@ -153,19 +159,55 @@ INSERT INTO child_config_traffic_selector ( /* Pools */ INSERT INTO pools ( - name, start, end, next, timeout + name, start, end, timeout ) VALUES ( - 'bigpool', X'0a030001', X'0a03fffe', X'0a030003', 3600 + 'bigpool', X'0a030001', X'0a030006', 3600 ); -INSERT INTO leases ( +INSERT INTO addresses ( pool, address, identity, acquired, released ) VALUES ( 1, X'0a030001', 7, 1211299013 , 1211299205 ); -INSERT INTO leases ( +INSERT INTO addresses ( pool, address, identity, acquired, released ) VALUES ( - 1, X'0a030002', 6, 1211299031, 1211299187 + 1, X'0a030002', 8, 1211299031, 1211299187 +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030003' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030004' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030005' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030006' +); + +INSERT INTO leases ( + address, identity, acquired, released +) VALUES ( + 1, 7, 1211299013 , 1211299205 +); + +INSERT INTO leases ( + address, identity, acquired, released +) VALUES ( + 2, 8, 1211299031, 1211299187 ); diff --git a/testing/tests/sql/ip-pool-db-restart/evaltest.dat b/testing/tests/sql/ip-pool-db-restart/evaltest.dat index 5db30da40..7a33cb6ba 100644 --- a/testing/tests/sql/ip-pool-db-restart/evaltest.dat +++ b/testing/tests/sql/ip-pool-db-restart/evaltest.dat @@ -9,9 +9,9 @@ dave::ip route list table 220::10.1.0.0/16.*src PH_IP_DAVE1::YES dave::ipsec status::home.*INSTALLED::YES dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES moon::cat /var/log/daemon.log::peer requested virtual IP %any::YES -moon::cat /var/log/daemon.log::reassigning address from valid lease from pool.*bigpool::YES +moon::cat /var/log/daemon.log::acquired existing lease for address.*in pool.*bigpool::YES moon::cat /var/log/daemon.log::assigning virtual IP::YES -moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.255.254.*static.*2::YES +moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.0.6.*static.*2::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.1,id=carol@strongswan.org::online::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.2,id=dave@strongswan.org::online::YES moon::ipsec status::rw.*ESTABLISHED.*carol@strongswan.org::YES diff --git a/testing/tests/sql/ip-pool-db-restart/hosts/moon/etc/ipsec.d/data.sql b/testing/tests/sql/ip-pool-db-restart/hosts/moon/etc/ipsec.d/data.sql index d250628e7..a55e82501 100644 --- a/testing/tests/sql/ip-pool-db-restart/hosts/moon/etc/ipsec.d/data.sql +++ b/testing/tests/sql/ip-pool-db-restart/hosts/moon/etc/ipsec.d/data.sql @@ -153,19 +153,55 @@ INSERT INTO child_config_traffic_selector ( /* Pools */ INSERT INTO pools ( - name, start, end, next, timeout + name, start, end, timeout ) VALUES ( - 'bigpool', X'0a030001', X'0a03fffe', X'0a030003', 0 + 'bigpool', X'0a030001', X'0a030006', 0 ); -INSERT INTO leases ( +INSERT INTO addresses ( pool, address, identity, acquired, released ) VALUES ( 1, X'0a030001', 6, 1211299013 , 1211299205 ); -INSERT INTO leases ( +INSERT INTO addresses ( pool, address, identity, acquired, released ) VALUES ( 1, X'0a030002', 7, 1211299031, 1211299187 ); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030003' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030004' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030005' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030006' +); + +INSERT INTO leases ( + address, identity, acquired, released +) VALUES ( + 1, 6, 1211299013 , 1211299205 +); + +INSERT INTO leases ( + address, identity, acquired, released +) VALUES ( + 2, 7, 1211299031, 1211299187 +); diff --git a/testing/tests/sql/ip-pool-db/evaltest.dat b/testing/tests/sql/ip-pool-db/evaltest.dat index 07d17b338..0aeeff9c8 100644 --- a/testing/tests/sql/ip-pool-db/evaltest.dat +++ b/testing/tests/sql/ip-pool-db/evaltest.dat @@ -9,9 +9,9 @@ dave::ip route list table 220::10.1.0.0/16.*src PH_IP_DAVE1::YES dave::ipsec status::home.*INSTALLED::YES dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES moon::cat /var/log/daemon.log::peer requested virtual IP %any::YES -moon::cat /var/log/daemon.log::assigning lease with new address from pool.*bigpool::YES +moon::cat /var/log/daemon.log::acquired new lease for address.*in pool.*bigpool::YES moon::cat /var/log/daemon.log::assigning virtual IP::YES -moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.255.254.*static.*2::YES +moon::ipsec pool --status::bigpool.*10.3.0.1.*10.3.0.6.*static.*2::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.1,id=carol@strongswan.org::online::YES moon::ipsec pool --leases --filter pool=bigpool,addr=10.3.0.2,id=dave@strongswan.org::online::YES moon::ipsec status::rw.*ESTABLISHED.*carol@strongswan.org::YES diff --git a/testing/tests/sql/ip-pool-db/hosts/moon/etc/ipsec.d/data.sql b/testing/tests/sql/ip-pool-db/hosts/moon/etc/ipsec.d/data.sql index b7585f56b..0d9399b5a 100644 --- a/testing/tests/sql/ip-pool-db/hosts/moon/etc/ipsec.d/data.sql +++ b/testing/tests/sql/ip-pool-db/hosts/moon/etc/ipsec.d/data.sql @@ -141,7 +141,43 @@ INSERT INTO child_config_traffic_selector ( /* Pools */ INSERT INTO pools ( - name, start, end, next, timeout + name, start, end, timeout ) VALUES ( - 'bigpool', X'0a030001', X'0a03fffe', X'0a030001', 0 + 'bigpool', X'0a030001', X'0a030006', 0 +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030001' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030002' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030003' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030004' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030005' +); + +INSERT INTO addresses ( + pool, address +) VALUES ( + 1, X'0a030006' ); -- cgit v1.2.3