Skip to content

Commit

Permalink
Merge pull request #377 from renanlopes97s/master
Browse files Browse the repository at this point in the history
Tests for VLAN
  • Loading branch information
Malinoski authored May 18, 2023
2 parents 4a64293 + e5f6cdf commit 444d18e
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 6 deletions.
10 changes: 10 additions & 0 deletions fast_start_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export REMOTE_CTRL_IP=$(nslookup netapi_odl | grep Address | tail -1 | awk '{pri
echo "Found SDN controller at $REMOTE_CTRL_IP"

echo "Starting tests.."

echo "=============== Tests for VLAN ================="
python manage.py test networkapi/api_vlan.tests.sanity.sync.test_vlan_delete.py
python manage.py test networkapi/api_vlan.tests.sanity.sync.test_vlan_get.py
python manage.py test networkapi/api_vlan.tests.sanity.sync.test_vlan_post.py
python manage.py test networkapi/api_vlan.tests.sanity.sync.test_vlan_put.py
python manage.py test networkapi/api_vlan.tests.unit.async.test_delete.py
python manage.py test networkapi/api_vlan.tests.unit.async.test_post.py
python manage.py test networkapi/api_vlan.tests.unit.async.test_put.py

echo "=============== Tests for IPV4 ================="
python manage.py test networkapi/api_ip.tests.sanity.ipv4.sync.test_delete.py
python manage.py test networkapi/api_ip.tests.sanity.ipv4.sync.test_get.py
Expand Down
58 changes: 57 additions & 1 deletion networkapi/api_vlan/fixtures/initial_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -743,5 +743,61 @@
},
"model": "ip.networkipv4",
"pk": 4
}
},
{
"fields": {
"network": "10.10.0.0/16",
"network_first_ip": "168427520",
"network_last_ip": "168493055",
"network_mask": "16",
"ip_version": "v4",
"id_network_type": 1,
"subnet_mask": "24",
"id_env": 3
},
"model": "ambiente.EnvCIDR",
"pk": 1
},
{
"fields": {
"network": "fc00:0000:0000:0000:0000:0000:0000:0000/57",
"network_first_ip": "334965454937798799971759379190646833152",
"network_last_ip": "334965454937798802332942620625469439999",
"network_mask": "57",
"ip_version": "v6",
"id_network_type": 1,
"subnet_mask": "64",
"id_env": 3
},
"model": "ambiente.EnvCIDR",
"pk": 2
},
{
"fields": {
"network": "10.10.0.0/16",
"network_first_ip": "168494592",
"network_last_ip": "168494847",
"network_mask": "16",
"ip_version": "v4",
"id_network_type": 1,
"subnet_mask": "24",
"id_env": 2
},
"model": "ambiente.EnvCIDR",
"pk": 3
},
{
"fields": {
"network": "fc00:0000:0000:0000:0000:0000:0000:0000/57",
"network_first_ip": "334965454937798799971759379190646833152",
"network_last_ip": "334965454937798802332942620625469439999",
"network_mask": "57",
"ip_version": "v6",
"id_network_type": 1,
"subnet_mask": "64",
"id_env": 2
},
"model": "ambiente.EnvCIDR",
"pk": 4
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"vrf": null,
"create_networkv4": {
"network_type": 1,
"prefix": 24,
"prefix": 29,
"environmentvip": 1
},
"create_networkv6": {
"network_type": 1,
"prefix": 64,
"prefix": 127,
"environmentvip": 1
}
},
"vxlan": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"id": 1,
"name": "VLAN NUM 2 - RACK-1",
"num_vlan": 2,
"vrf": null
"vrf": null,
"vxlan": false
}
]
}
2 changes: 1 addition & 1 deletion networkapi/api_vlan/tests/sanity/sync/test_vlan_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_get_search_vlan_field_error(self):
' Choices are: acl_draft, acl_draft_v6, acl_file_name,' + \
' acl_file_name_v6, acl_valida, acl_valida_v6, ambiente,' + \
' ativada, descricao, id, networkipv4, networkipv6, nome,' +\
' num_vlan, vrf, vrfvlanequipment'
' num_vlan, vrf, vrfvlanequipment, vxlan'

self.assertEqual(
expected_data,
Expand Down

0 comments on commit 444d18e

Please sign in to comment.