mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 16:26:59 +00:00
tests: improve coverage
Add error condition checks. Add lease file binding states. Check all output formats. Check leases file that is in mad order, cse all sorting methods when checking this. Use json output to check status classfications. Add cidr range checks. Add conf include and comment parsing input checks. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
2849dde21b
commit
447241e6c3
33 changed files with 1059 additions and 51 deletions
241
tests/leases/binding-states
Normal file
241
tests/leases/binding-states
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
lease 10.0.0.0 {
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
}
|
||||
|
||||
lease 10.0.0.1 {
|
||||
binding state free;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
lease 10.0.0.1 {
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
lease 10.0.0.1 {
|
||||
binding state abandoned;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
lease 10.0.0.1 {
|
||||
binding state expired;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
lease 10.0.0.1 {
|
||||
binding state released;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
lease 10.0.0.1 {
|
||||
binding state backup;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
|
||||
lease 10.0.0.2 {
|
||||
binding state free;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
lease 10.0.0.2 {
|
||||
binding state abandoned;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
lease 10.0.0.2 {
|
||||
binding state expired;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
lease 10.0.0.2 {
|
||||
binding state released;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
lease 10.0.0.2 {
|
||||
binding state backup;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
lease 10.0.0.2 {
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
}
|
||||
|
||||
lease 10.0.0.3 {
|
||||
binding state free;
|
||||
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 expired;
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
}
|
||||
lease 10.0.0.6 {
|
||||
binding state released;
|
||||
hardware ethernet 00:00:00:00:00:06;
|
||||
}
|
||||
lease 10.0.0.7 {
|
||||
binding state backup;
|
||||
hardware ethernet 00:00:00:00:00:07;
|
||||
}
|
||||
lease 10.0.0.8 {
|
||||
binding state none-existing-state;
|
||||
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.20 {
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:10;
|
||||
}
|
||||
lease 10.0.0.21 {
|
||||
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;
|
||||
}
|
||||
1
tests/leases/cidr-v4
Symbolic link
1
tests/leases/cidr-v4
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
complete
|
||||
1
tests/leases/cidr-v6
Symbolic link
1
tests/leases/cidr-v6
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
v6
|
||||
1
tests/leases/formats
Symbolic link
1
tests/leases/formats
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
complete
|
||||
1
tests/leases/parser
Symbolic link
1
tests/leases/parser
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
complete
|
||||
198
tests/leases/shufled
Normal file
198
tests/leases/shufled
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
lease 10.0.0.7 {
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:07;
|
||||
hardware ethernet 00:00:00:00:00:10;
|
||||
lease 10.2.0.4 {
|
||||
lease 10.2.0.6 {
|
||||
lease 10.0.0.11 {
|
||||
binding state active;
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:03;
|
||||
lease 10.3.0.9 {
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:04;
|
||||
}
|
||||
binding state active;
|
||||
lease 10.1.0.7 {
|
||||
}
|
||||
}
|
||||
lease 10.1.0.9 {
|
||||
|
||||
hardware ethernet 00:00:00:00:00:07;
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
binding state active;
|
||||
binding state active;
|
||||
}
|
||||
}
|
||||
}
|
||||
binding state active;
|
||||
lease 10.4.0.1 {
|
||||
}
|
||||
lease 10.0.0.0 {
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:10;
|
||||
}
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
}
|
||||
}
|
||||
binding state active;
|
||||
}
|
||||
lease 10.3.0.2 {
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
binding state active;
|
||||
lease 10.1.0.3 {
|
||||
binding state active;
|
||||
}
|
||||
binding state active;
|
||||
}
|
||||
lease 10.1.0.1 {
|
||||
lease 10.3.0.8 {
|
||||
lease 10.2.0.1 {
|
||||
hardware ethernet 00:00:00:00:00:07;
|
||||
}
|
||||
}
|
||||
lease 10.4.0.0 {
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
lease 10.0.0.10 {
|
||||
binding state active;
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:04;
|
||||
hardware ethernet 00:00:00:00:00:11;
|
||||
hardware ethernet 00:00:00:00:00:08;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:08;
|
||||
binding state active;
|
||||
lease 10.2.0.5 {
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
lease 10.1.0.8 {
|
||||
|
||||
lease 10.0.0.3 {
|
||||
binding state active;
|
||||
binding state active;
|
||||
lease 10.0.0.1 {
|
||||
lease 10.4.0.5 {
|
||||
hardware ethernet 00:00:00:00:00:06;
|
||||
|
||||
hardware ethernet 00:00:00:00:00:06;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
lease 10.2.0.3 {
|
||||
binding state active;
|
||||
lease 10.1.0.10 {
|
||||
binding state active;
|
||||
}
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:03;
|
||||
}
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
lease 10.0.0.2 {
|
||||
}
|
||||
binding state active;
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:06;
|
||||
lease 10.3.0.6 {
|
||||
lease 10.0.0.8 {
|
||||
hardware ethernet 00:00:00:00:00:01;
|
||||
lease 10.4.0.3 {
|
||||
}
|
||||
}
|
||||
}
|
||||
binding state active;
|
||||
binding state active;
|
||||
lease 10.1.0.6 {
|
||||
lease 10.1.0.2 {
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
binding state active;
|
||||
}
|
||||
}
|
||||
lease 10.2.0.7 {
|
||||
}
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:03;
|
||||
binding state active;
|
||||
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:03;
|
||||
}
|
||||
lease 10.1.0.0 {
|
||||
hardware ethernet 00:00:00:00:00:04;
|
||||
binding state active;
|
||||
}
|
||||
lease 10.3.0.1 {
|
||||
lease 10.2.0.2 {
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:09;
|
||||
}
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
binding state active;
|
||||
lease 10.0.0.6 {
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
binding state active;
|
||||
}
|
||||
binding state active;
|
||||
}
|
||||
lease 10.3.0.0 {
|
||||
lease 10.0.0.9 {
|
||||
binding state active;
|
||||
lease 10.0.0.4 {
|
||||
hardware ethernet 00:00:00:00:00:08;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:07;
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
binding state active;
|
||||
lease 10.1.0.4 {
|
||||
lease 10.4.0.2 {
|
||||
binding state active;
|
||||
}
|
||||
}
|
||||
lease 10.3.0.4 {
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
binding state active;
|
||||
binding state active;
|
||||
lease 10.0.0.5 {
|
||||
hardware ethernet 00:00:00:00:00:04;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:02;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:09;
|
||||
hardware ethernet 00:00:00:00:00:08;
|
||||
lease 10.2.0.8 {
|
||||
}
|
||||
binding state active;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:06;
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
lease 10.3.0.7 {
|
||||
lease 10.4.0.4 {
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:04;
|
||||
}
|
||||
binding state active;
|
||||
lease 10.3.0.3 {
|
||||
hardware ethernet 00:00:00:00:00:03;
|
||||
lease 10.2.0.0 {
|
||||
binding state active;
|
||||
binding state active;
|
||||
hardware ethernet 00:00:00:00:00:05;
|
||||
|
||||
binding state active;
|
||||
}
|
||||
hardware ethernet 00:00:00:00:00:00;
|
||||
binding state active;
|
||||
lease 10.1.0.5 {
|
||||
hardware ethernet 00:00:00:00:00:09;
|
||||
lease 10.3.0.5 {
|
||||
}
|
||||
|
||||
1
tests/leases/statuses
Symbolic link
1
tests/leases/statuses
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
complete
|
||||
Loading…
Add table
Add a link
Reference in a new issue