tests: add complete check including multiple ranges and shared networks

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2013-01-16 12:56:22 +00:00
parent f3a476ba52
commit 8e2da89c88
5 changed files with 247 additions and 0 deletions

View file

@ -1,5 +1,6 @@
TESTS = \
bootp \
complete \
full-json \
leading0 \
same-twice \

1
tests/complete Symbolic link
View file

@ -0,0 +1 @@
test.sh

31
tests/confs/complete Normal file
View file

@ -0,0 +1,31 @@
shared-network example1 {
subnet 10.0.0.0 netmask 255.255.255.0 {
pool {
range 10.0.0.1 10.0.0.20;
}
}
subnet 10.1.0.0 netmask 255.255.255.0 {
pool {
range 10.1.0.1 10.1.0.20;
}
}
}
shared-network example2 {
subnet 10.2.0.0 netmask 255.255.255.0 {
pool {
range 10.2.0.1 10.2.0.20;
}
}
subnet 10.3.0.0 netmask 255.255.255.0 {
pool {
range 10.3.0.1 10.3.0.20;
}
}
}
subnet 10.4.0.0 netmask 255.255.255.0 {
pool {
range 10.4.0.1 10.4.0.20;
}
}

16
tests/expected/complete Normal file
View file

@ -0,0 +1,16 @@
Ranges:
shared net name first ip last ip max cur percent touch t+c t+c perc
example1 10.0.0.1 - 10.0.0.20 20 11 55.000 0 11 55.000
example1 10.1.0.1 - 10.1.0.20 20 10 50.000 0 10 50.000
example2 10.2.0.1 - 10.2.0.20 20 8 40.000 0 8 40.000
example2 10.3.0.1 - 10.3.0.20 20 9 45.000 0 9 45.000
All networks 10.4.0.1 - 10.4.0.20 20 5 25.000 0 5 25.000
Shared networks:
name max cur percent touch t+c t+c perc
example1 40 21 52.500 0 21 52.500
example2 40 17 42.500 0 17 42.500
Sum of all ranges:
name max cur percent touch t+c t+c perc
All networks 100 43 43.000 0 43 43.000

198
tests/leases/complete Normal file
View file

@ -0,0 +1,198 @@
lease 10.0.0.0 {
binding state active;
hardware ethernet 00:00:00:00:00:00;
}
lease 10.0.0.1 {
binding state active;
hardware ethernet 00:00:00:00:00:01;
}
lease 10.0.0.2 {
binding state active;
hardware ethernet 00:00:00:00:00:02;
}
lease 10.0.0.3 {
binding state active;
hardware ethernet 00:00:00:00:00:03;
}
lease 10.0.0.4 {
binding state active;
hardware ethernet 00:00:00:00:00:04;
}
lease 10.0.0.5 {
binding state active;
hardware ethernet 00:00:00:00:00:05;
}
lease 10.0.0.6 {
binding state active;
hardware ethernet 00:00:00:00:00:06;
}
lease 10.0.0.7 {
binding state active;
hardware ethernet 00:00:00:00:00:07;
}
lease 10.0.0.8 {
binding state active;
hardware ethernet 00:00:00:00:00:08;
}
lease 10.0.0.9 {
binding state active;
hardware ethernet 00:00:00:00:00:09;
}
lease 10.0.0.10 {
binding state active;
hardware ethernet 00:00:00:00:00:10;
}
lease 10.0.0.11 {
binding state active;
hardware ethernet 00:00:00:00:00:11;
}
lease 10.1.0.0 {
binding state active;
hardware ethernet 00:00:00:00:00:00;
}
lease 10.1.0.1 {
binding state active;
hardware ethernet 00:00:00:00:00:01;
}
lease 10.1.0.2 {
binding state active;
hardware ethernet 00:00:00:00:00:02;
}
lease 10.1.0.3 {
binding state active;
hardware ethernet 00:00:00:00:00:03;
}
lease 10.1.0.4 {
binding state active;
hardware ethernet 00:00:00:00:00:04;
}
lease 10.1.0.5 {
binding state active;
hardware ethernet 00:00:00:00:00:05;
}
lease 10.1.0.6 {
binding state active;
hardware ethernet 00:00:00:00:00:06;
}
lease 10.1.0.7 {
binding state active;
hardware ethernet 00:00:00:00:00:07;
}
lease 10.1.0.8 {
binding state active;
hardware ethernet 00:00:00:00:00:08;
}
lease 10.1.0.9 {
binding state active;
hardware ethernet 00:00:00:00:00:09;
}
lease 10.1.0.10 {
binding state active;
hardware ethernet 00:00:00:00:00:10;
}
lease 10.2.0.0 {
binding state active;
hardware ethernet 00:00:00:00:00:00;
}
lease 10.2.0.1 {
binding state active;
hardware ethernet 00:00:00:00:00:01;
}
lease 10.2.0.2 {
binding state active;
hardware ethernet 00:00:00:00:00:02;
}
lease 10.2.0.3 {
binding state active;
hardware ethernet 00:00:00:00:00:03;
}
lease 10.2.0.4 {
binding state active;
hardware ethernet 00:00:00:00:00:04;
}
lease 10.2.0.5 {
binding state active;
hardware ethernet 00:00:00:00:00:05;
}
lease 10.2.0.6 {
binding state active;
hardware ethernet 00:00:00:00:00:06;
}
lease 10.2.0.7 {
binding state active;
hardware ethernet 00:00:00:00:00:07;
}
lease 10.2.0.8 {
binding state active;
hardware ethernet 00:00:00:00:00:08;
}
lease 10.3.0.0 {
binding state active;
hardware ethernet 00:00:00:00:00:00;
}
lease 10.3.0.1 {
binding state active;
hardware ethernet 00:00:00:00:00:01;
}
lease 10.3.0.2 {
binding state active;
hardware ethernet 00:00:00:00:00:02;
}
lease 10.3.0.3 {
binding state active;
hardware ethernet 00:00:00:00:00:03;
}
lease 10.3.0.4 {
binding state active;
hardware ethernet 00:00:00:00:00:04;
}
lease 10.3.0.5 {
binding state active;
hardware ethernet 00:00:00:00:00:05;
}
lease 10.3.0.6 {
binding state active;
hardware ethernet 00:00:00:00:00:06;
}
lease 10.3.0.7 {
binding state active;
hardware ethernet 00:00:00:00:00:07;
}
lease 10.3.0.8 {
binding state active;
hardware ethernet 00:00:00:00:00:08;
}
lease 10.3.0.9 {
binding state active;
hardware ethernet 00:00:00:00:00:09;
}
lease 10.4.0.0 {
binding state active;
hardware ethernet 00:00:00:00:00:00;
}
lease 10.4.0.1 {
binding state active;
hardware ethernet 00:00:00:00:00:01;
}
lease 10.4.0.2 {
binding state active;
hardware ethernet 00:00:00:00:00:02;
}
lease 10.4.0.3 {
binding state active;
hardware ethernet 00:00:00:00:00:03;
}
lease 10.4.0.4 {
binding state active;
hardware ethernet 00:00:00:00:00:04;
}
lease 10.4.0.5 {
binding state active;
hardware ethernet 00:00:00:00:00:05;
}