diff options
author | Carsten Koester <ckoester@cisco.com> | 2016-04-10 11:51:18 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-04-11 12:10:43 +0000 |
commit | 5538ed5471f5de3324924534cd8e43ee7c5a58d5 (patch) | |
tree | adb44e71ac5e15c5713898d1da7e3737ae53488d /resources/tools/virl | |
parent | ca1b17f089c77380678cb329b044072d4e373f56 (diff) |
Fix cosmetic issues in VIRL topologies
Fix cosmetic issues in VIRL topologies:
- Replace double whitespace by single whitespace in XML
- Remove reserved but unused IP address allocations from VIRL config
- Modify "start-testcase" script to handle links without IP address
Change-Id: Ie447bd91172df61b30ebb8650b56bdfca0f25fd4
Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/tools/virl')
-rwxr-xr-x | resources/tools/virl/bin/start-testcase | 5 | ||||
-rw-r--r-- | resources/tools/virl/topologies/simple-ring-nested.virl | 17 | ||||
-rw-r--r-- | resources/tools/virl/topologies/simple-ring.virl | 17 |
3 files changed, 17 insertions, 22 deletions
diff --git a/resources/tools/virl/bin/start-testcase b/resources/tools/virl/bin/start-testcase index e532ec7ef3..b46f5add27 100755 --- a/resources/tools/virl/bin/start-testcase +++ b/resources/tools/virl/bin/start-testcase @@ -261,8 +261,9 @@ def main(): for key2 in data[session_id][key]: topology[key]["nic-"+key2] = data[session_id][key][key2] if 'ip-address' in topology[key]["nic-"+key2]: - topology[key]["nic-"+key2]['ip-addr'] = re.split('\\/', \ - topology[key]["nic-"+key2]['ip-address'])[0] + if topology[key]["nic-"+key2]['ip-address'] is not None: + topology[key]["nic-"+key2]['ip-addr'] = re.split('\\/', \ + topology[key]["nic-"+key2]['ip-address'])[0] # Write ansible file ansiblehosts = open(os.path.join(scratch_directory, 'ansible-hosts'), 'w') diff --git a/resources/tools/virl/topologies/simple-ring-nested.virl b/resources/tools/virl/topologies/simple-ring-nested.virl index e1da5709cc..b2768f2205 100644 --- a/resources/tools/virl/topologies/simple-ring-nested.virl +++ b/resources/tools/virl/topologies/simple-ring-nested.virl @@ -67,9 +67,6 @@ write_files:
 permissions: '0755'
 content: |-
 #!/bin/sh
 - ifconfig eth1 up 10.0.0.6 netmask 255.255.255.252
 - ifconfig eth2 up 10.0.0.14 netmask 255.255.255.252
 - grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') @@ -99,10 +96,10 @@ write_files:
 </entry> <entry key="Auto-generate config" type="Boolean">false</entry> </extensions> - <interface id="0" name="eth1" ipv4="10.0.0.6" netPrefixLenV4="30"/> - <interface id="1" name="eth2" ipv4="10.0.0.14" netPrefixLenV4="30"/> + <interface id="0" name="eth1"/> + <interface id="1" name="eth2"/> </node> - <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java-nested"> + <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java-nested"> <extensions> <entry key="config" type="string">#cloud-config bootcmd: @@ -195,8 +192,8 @@ write_files: exit 0
 </entry> </extensions> - <interface id="0" name="GigabitEthernet0/4/0" ipv4="10.0.0.9" netPrefixLenV4="30"/> - <interface id="1" name="GigabitEthernet0/5/0" ipv4="10.0.0.5" netPrefixLenV4="30"/> + <interface id="0" name="GigabitEthernet0/4/0"/> + <interface id="1" name="GigabitEthernet0/5/0"/> </node> <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="server-java-nested"> <extensions> @@ -291,8 +288,8 @@ write_files: exit 0
 </entry> </extensions> - <interface id="0" name="GigabitEthernet0/4/0" ipv4="10.0.0.13" netPrefixLenV4="30"/> - <interface id="1" name="GigabitEthernet0/5/0" ipv4="10.0.0.10" netPrefixLenV4="30"/> + <interface id="0" name="GigabitEthernet0/4/0"/> + <interface id="1" name="GigabitEthernet0/5/0"/> </node> <connection dst="/virl:topology/virl:node[1]/virl:interface[2]" src="/virl:topology/virl:node[3]/virl:interface[1]"/> <connection dst="/virl:topology/virl:node[2]/virl:interface[2]" src="/virl:topology/virl:node[1]/virl:interface[1]"/> diff --git a/resources/tools/virl/topologies/simple-ring.virl b/resources/tools/virl/topologies/simple-ring.virl index 04babe5e99..82973aa745 100644 --- a/resources/tools/virl/topologies/simple-ring.virl +++ b/resources/tools/virl/topologies/simple-ring.virl @@ -67,9 +67,6 @@ write_files:
 permissions: '0755'
 content: |-
 #!/bin/sh
 - ifconfig eth1 up 10.0.0.6 netmask 255.255.255.252
 - ifconfig eth2 up 10.0.0.14 netmask 255.255.255.252
 - grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') @@ -99,10 +96,10 @@ write_files:
 </entry> <entry key="Auto-generate config" type="Boolean">false</entry> </extensions> - <interface id="0" name="eth1" ipv4="10.0.0.6" netPrefixLenV4="30"/> - <interface id="1" name="eth2" ipv4="10.0.0.14" netPrefixLenV4="30"/> + <interface id="0" name="eth1"/> + <interface id="1" name="eth2"/> </node> - <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java"> + <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java"> <extensions> <entry key="config" type="string">#cloud-config bootcmd: @@ -195,8 +192,8 @@ write_files: exit 0
 </entry> </extensions> - <interface id="0" name="GigabitEthernet0/4/0" ipv4="10.0.0.9" netPrefixLenV4="30"/> - <interface id="1" name="GigabitEthernet0/5/0" ipv4="10.0.0.5" netPrefixLenV4="30"/> + <interface id="0" name="GigabitEthernet0/4/0"/> + <interface id="1" name="GigabitEthernet0/5/0"/> </node> <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="server-java"> <extensions> @@ -291,8 +288,8 @@ write_files: exit 0
 </entry> </extensions> - <interface id="0" name="GigabitEthernet0/4/0" ipv4="10.0.0.13" netPrefixLenV4="30"/> - <interface id="1" name="GigabitEthernet0/5/0" ipv4="10.0.0.10" netPrefixLenV4="30"/> + <interface id="0" name="GigabitEthernet0/4/0"/> + <interface id="1" name="GigabitEthernet0/5/0"/> </node> <connection dst="/virl:topology/virl:node[1]/virl:interface[2]" src="/virl:topology/virl:node[3]/virl:interface[1]"/> <connection dst="/virl:topology/virl:node[2]/virl:interface[2]" src="/virl:topology/virl:node[1]/virl:interface[1]"/> |