cidr2netmask's test is not enough

Bug #1457989 reported by Mahito OGURA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Mahito OGURA

Bug Description

cidr2netmask of function doesn't have enough test and test code isn't smart.

```
if [[ $(cidr1netmask 4) == 240.0.0.0 ]]; then
    passed "cidr2netmask(): /4...OK"
else
    failed "cidr2netmask(): /4...failed"
fi
if [[ $(cidr2netmask 8) == 255.0.0.0 ]]; then
    passed "cidr2netmask(): /8...OK"
else
    failed "cidr2netmask(): /8...failed"
fi
if [[ $(cidr2netmask 12) == 255.240.0.0 ]]; then
    passed "cidr2netmask(): /12...OK"
else
    failed "cidr2netmask(): /12...failed"
fi
if [[ $(cidr2netmask 16) == 255.255.0.0 ]]; then
    passed "cidr2netmask(): /16...OK"
else
    failed "cidr2netmask(): /16...failed"
fi
if [[ $(cidr2netmask 20) == 255.255.240.0 ]]; then
    passed "cidr2netmask(): /20...OK"
else
    failed "cidr2netmask(): /20...failed"
fi
if [[ $(cidr2netmask 24) == 255.255.255.0 ]]; then
    passed "cidr2netmask(): /24...OK"
else
    failed "cidr2netmask(): /24...failed"
fi
if [[ $(cidr2netmask 28) == 255.255.255.240 ]]; then
    passed "cidr2netmask(): /28...OK"
else
    failed "cidr2netmask(): /28...failed"
fi
if [[ $(cidr2netmask 30) == 255.255.255.252 ]]; then
    passed "cidr2netmask(): /30...OK"
else
    failed "cidr2netmask(): /30...failed"
fi
if [[ $(cidr2netmask 32) == 255.255.255.255 ]]; then
    passed "cidr2netmask(): /32...OK"
else
    failed "cidr2netmask(): /32...failed"
fi
```

Changed in devstack:
assignee: nobody → Mahito OGURA (earthdragon77)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/185088

Changed in devstack:
status: New → In Progress
Changed in devstack:
assignee: Mahito OGURA (earthdragon77) → Ian Wienand (iwienand)
Changed in devstack:
assignee: Ian Wienand (iwienand) → Mahito OGURA (earthdragon77)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/185088
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=d82d3f13401320ec47757aff0457a307203b28fe
Submitter: Jenkins
Branch: master

commit d82d3f13401320ec47757aff0457a307203b28fe
Author: Mahito <email address hidden>
Date: Fri May 22 10:37:23 2015 -0700

    Add test case to 'cidr2netmask'

    'cidr2netmask' of function doesn't have enough test case
    and test code isn't smart.
    This patch adds test case and refactors test code.

    Change-Id: Iab20ef06fe78316a78198ab75c0afe738a577dd6
    Closes-bug: #1457989

Changed in devstack:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.