HomeClusterLabs Projects

Low: tools/findif: add test-findif.sh

Description

Low: tools/findif: add test-findif.sh

Basically, this validates previous findif changes.

As can be seen, the patches do not introduce regression (at least in the
tested cases), but additionally fix cases where netmask is specified
in the IP-like but broken form.

Before the changes:

[...]

  • 30) DUMMY_IP+1, explicit *invalid* netmask (missing last item in quad)

OCF_RESKEY_ip=198.51.100.2 OCF_RESKEY_cidr_netmask=255.255.255.
Converted dotted-quad netmask to CIDR as: 6
FAIL exit code: 0 vs 6
[FAIL]

  • 30) DUMMY_IP+1, explicit *invalid* netmask (random string containing dot)

OCF_RESKEY_ip=198.51.100.2 OCF_RESKEY_cidr_netmask=foo.bar
Converted dotted-quad netmask to CIDR as: 6
FAIL exit code: 0 vs 6
[FAIL]

  • TOTAL ---

[FAIL] 2
[...]

After the changes:

[...]

  • 30) DUMMY_IP+1, explicit *invalid* netmask (missing last item in

quad)
OCF_RESKEY_ip=198.51.100.2 OCF_RESKEY_cidr_netmask=255.255.255.
Converted dotted-quad netmask to CIDR as: -1
Invalid netmask specification [255.255.255.]
[ OK ]

  • 30) DUMMY_IP+1, explicit *invalid* netmask (random string

containing dot)
OCF_RESKEY_ip=198.51.100.2 OCF_RESKEY_cidr_netmask=foo.bar
Converted dotted-quad netmask to CIDR as: -1
Invalid netmask specification [foo.bar]
[ OK ]

  • TOTAL ---

[ OK ]
[...]

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Oct 5 2012, 9:07 AM
Parents
rR304eb213657e: Low: tools/findif: sanitize SearchUsingRouteCmd a bit
Branches
Unknown
Tags
Unknown

Event Timeline