aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/virl
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/virl')
-rwxr-xr-xresources/tools/virl/bin/start-testcase23
-rwxr-xr-xresources/tools/virl/bin/stop-testcase2
-rw-r--r--resources/tools/virl/topologies/double-ring-nested.virl25
-rw-r--r--resources/tools/virl/topologies/simple-ring-nested.virl297
-rw-r--r--resources/tools/virl/topologies/simple-ring-nested.yaml59
-rw-r--r--resources/tools/virl/topologies/simple-ring.virl297
-rw-r--r--resources/tools/virl/topologies/simple-ring.yaml59
7 files changed, 40 insertions, 722 deletions
diff --git a/resources/tools/virl/bin/start-testcase b/resources/tools/virl/bin/start-testcase
index b46f5add27..10028e6516 100755
--- a/resources/tools/virl/bin/start-testcase
+++ b/resources/tools/virl/bin/start-testcase
@@ -24,6 +24,7 @@ import tempfile
import shutil
import time
import paramiko
+import netifaces
#
# Helper function to indent a text string
@@ -40,6 +41,14 @@ def indent(lines, amount, fillchar=' '):
#
def main():
#
+ # Get our default interface IP address. This will become the default
+ # value for the "NFS Server IP" option.
+ #
+ gws = netifaces.gateways()
+ addrs = netifaces.ifaddresses(gws['default'][netifaces.AF_INET][1])
+ default_addr = addrs[netifaces.AF_INET][0]['addr']
+
+ #
# Verify CLI parameters and try to download our VPP image into a temporary
# file first
#
@@ -53,11 +62,9 @@ def main():
parser.add_argument("-k", "--keep", help="Keep (do not delete) the " +
"simulation in case of error", action='store_true')
parser.add_argument("-v", "--verbosity", action="count", default=0)
- # FIXME: THe default value for the following line should not be a hardcoded
- # address. We should determine it dynamically (e.g. IP address of first
- # interface or whichever interface is tied to the flat network)
- parser.add_argument("-nip", "--nfs-server-ip", help="NFS server (our) IP",
- default="10.30.51.28")
+ parser.add_argument("-nip", "--nfs-server-ip", help="NFS server (our) IP " +
+ "default is derived from routing table: " +
+ "{}".format(default_addr), default=default_addr)
parser.add_argument("-ns", "--nfs-scratch-directory",
help="Server location for NFS scratch diretory",
default="/nfs/scratch")
@@ -66,7 +73,7 @@ def main():
"directory", default="/nfs/common")
parser.add_argument("-wc", "--wait-count",
help="number of intervals to wait for simulation to " +
- "be ready", type=int, default=12)
+ "be ready", type=int, default=24)
parser.add_argument("-wt", "--wait-time",
help="length of a single interval to wait for " +
"simulation to be ready", type=int, default=5)
@@ -83,6 +90,9 @@ def main():
default="/home/jenkins-in/.ssh/id_rsa_virl")
parser.add_argument("-spu", "--ssh-pubkey", help="SSH public keyfile",
default="/home/jenkins-in/.ssh/id_rsa_virl.pub")
+ parser.add_argument("-r", "--release", help="VM disk image/release " +
+ "(ex. \"csit-ubuntu-14.04.4_2016-05-25_1.0\")",
+ default="csit-ubuntu-14.04.4_2016-05-25_1.0")
parser.add_argument("--topology-directory", help="Topology directory",
default="/home/jenkins-in/testcase-infra/topologies")
@@ -134,6 +144,7 @@ def main():
args.nfs_server_ip+":"+args.nfs_scratch_directory)
line = line.replace("$$NFS_SERVER_COMMON$$", \
args.nfs_server_ip+":"+args.nfs_common_directory)
+ line = line.replace("$$VM_IMAGE$$", "server-"+args.release)
new_file.write(line)
os.close(temp_handle)
diff --git a/resources/tools/virl/bin/stop-testcase b/resources/tools/virl/bin/stop-testcase
index dbbb53e30f..1175fcf2b5 100755
--- a/resources/tools/virl/bin/stop-testcase
+++ b/resources/tools/virl/bin/stop-testcase
@@ -21,4 +21,4 @@ NFS_SCRATCH_SERVERDIR="/nfs/scratch" # Our own (NFS s
TESTCASE=$1
virl_std_client -u $VIRL_USER -p $VIRL_PASSWORD simengine-stop --session-id $TESTCASE
-rm -fr ${NFS_SCRATCH_SERVERDIR}/${TESTCASE}
+sudo rm -fr ${NFS_SCRATCH_SERVERDIR}/${TESTCASE}
diff --git a/resources/tools/virl/topologies/double-ring-nested.virl b/resources/tools/virl/topologies/double-ring-nested.virl
index 9018cb529f..4dd5885281 100644
--- a/resources/tools/virl/topologies/double-ring-nested.virl
+++ b/resources/tools/virl/topologies/double-ring-nested.virl
@@ -3,7 +3,7 @@
<extensions>
<entry key="management_network" type="String">flat</entry>
</extensions>
- <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="server-java-nested">
+ <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="$$VM_IMAGE$$">
<extensions>
<entry key="config" type="String">#cloud-config&#xD;
bootcmd:&#xD;
@@ -91,6 +91,7 @@ write_files:&#xD;
mount -t nfs "${nfs_server_common}" /mnt/common
mkdir /scratch/$(hostname)
+ cp /VERSION /scratch/$(hostname)/
exit 0&#xD;
</entry>
@@ -103,7 +104,7 @@ write_files:&#xD;
<interface id="4" name="eth5"/>
<interface id="5" name="eth6"/>
</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="$$VM_IMAGE$$">
<extensions>
<entry key="config" type="string">#cloud-config
bootcmd:
@@ -191,7 +192,16 @@ write_files:
mount -t nfs "${nfs_server_common}" /mnt/common
+ # Overwrite nested VM image with latest as per NFS
+ if [ -f /mnt/common/nested-vm-current.img ]
+ then
+ rm -f /var/lib/vm/vhost-nested.img
+ cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img
+ fi
+
mkdir /scratch/$(hostname)
+ cp /VERSION /scratch/$(hostname)/
+ cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION
exit 0&#xD;
</entry>
@@ -201,7 +211,7 @@ write_files:
<interface id="2" name="GigabitEthernet0/6/0"/>
<interface id="3" name="GigabitEthernet0/7/0"/>
</node>
- <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="server-java-nested">
+ <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="$$VM_IMAGE$$">
<extensions>
<entry key="config" type="string">#cloud-config
bootcmd:
@@ -289,7 +299,16 @@ write_files:
mount -t nfs "${nfs_server_common}" /mnt/common
+ # Overwrite nested VM image with latest as per NFS
+ if [ -f /mnt/common/nested-vm-current.img ]
+ then
+ rm -f /var/lib/vm/vhost-nested.img
+ cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img
+ fi
+
mkdir /scratch/$(hostname)
+ cp /VERSION /scratch/$(hostname)/
+ cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION
exit 0&#xD;
</entry>
diff --git a/resources/tools/virl/topologies/simple-ring-nested.virl b/resources/tools/virl/topologies/simple-ring-nested.virl
deleted file mode 100644
index b2768f2205..0000000000
--- a/resources/tools/virl/topologies/simple-ring-nested.virl
+++ /dev/null
@@ -1,297 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<topology xmlns="http://www.cisco.com/VIRL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="0.9" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
- <extensions>
- <entry key="management_network" type="String">flat</entry>
- </extensions>
- <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="server-java-nested">
- <extensions>
- <entry key="config" type="String">#cloud-config&#xD;
-bootcmd:&#xD;
-- ln -s -t /etc/rc.d /etc/rc.local&#xD;
-hostname: tg1&#xD;
-manage_etc_hosts: true&#xD;
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:&#xD;
-- start ttyS0&#xD;
-- systemctl start getty@ttyS0.service&#xD;
-- systemctl start rc-local&#xD;
-- touch /tmp/before-sed&#xD;
-- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config&#xD;
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
-- service ssh restart&#xD;
-- service sshd restart&#xD;
-users:&#xD;
-- default&#xD;
-- gecos: User configured by VIRL Configuration Engine 0.21.4&#xD;
- lock-passwd: false&#xD;
- name: cisco&#xD;
- plain-text-passwd: cisco&#xD;
- shell: /bin/bash&#xD;
- ssh-authorized-keys:&#xD;
- - VIRL-USER-SSH-PUBLIC-KEY&#xD;
- - VIRL-USER-SSH-PUBLIC-KEY&#xD;
- sudo: ALL=(ALL) NOPASSWD:ALL&#xD;
-write_files:&#xD;
-- path: /etc/init/ttyS0.conf&#xD;
- owner: root:root&#xD;
- content: |&#xD;
- # ttyS0 - getty&#xD;
- # This service maintains a getty on ttyS0 from the point the system is&#xD;
- # started until it is shut down again.&#xD;
- start on stopped rc or RUNLEVEL=[12345]&#xD;
- stop on runlevel [!12345]&#xD;
- respawn&#xD;
- exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
- permissions: '0644'&#xD;
-- path: /etc/systemd/system/dhclient@.service&#xD;
- content: |&#xD;
- [Unit]&#xD;
- Description=Run dhclient on %i interface&#xD;
- After=network.target&#xD;
- [Service]&#xD;
- Type=oneshot&#xD;
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
- RemainAfterExit=yes&#xD;
- owner: root:root&#xD;
- permissions: '0644'&#xD;
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- <entry key="Auto-generate config" type="Boolean">false</entry>
- </extensions>
- <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">
- <extensions>
- <entry key="config" type="string">#cloud-config
-bootcmd:
-- ln -s -t /etc/rc.d /etc/rc.local
-hostname: sut1
-manage_etc_hosts: true
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:
-- start ttyS0
-- systemctl start getty@ttyS0.service
-- systemctl start rc-local
-- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
-- service ssh restart
-- service sshd restart
-- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
-- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
-users:
-- default
-- gecos: User configured by VIRL Configuration Engine 0.21.4
- lock-passwd: false
- name: cisco
- plain-text-passwd: cisco
- shell: /bin/bash
- ssh-authorized-keys:
- - VIRL-USER-SSH-PUBLIC-KEY
- - VIRL-USER-SSH-PUBLIC-KEY
- sudo: ALL=(ALL) NOPASSWD:ALL
-write_files:
-- path: /etc/init/ttyS0.conf
- owner: root:root
- content: |
- # ttyS0 - getty
- # This service maintains a getty on ttyS0 from the point the system is
- # started until it is shut down again.
- start on stopped rc or RUNLEVEL=[12345]
- stop on runlevel [!12345]
- respawn
- exec /sbin/getty -L 115200 ttyS0 vt102
- permissions: '0644'
-- path: /etc/systemd/system/dhclient@.service
- content: |
- [Unit]
- Description=Run dhclient on %i interface
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
- RemainAfterExit=yes
- owner: root:root
- permissions: '0644'
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- </extensions>
- <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>
- <entry key="config" type="string">#cloud-config
-bootcmd:
-- ln -s -t /etc/rc.d /etc/rc.local
-hostname: sut2
-manage_etc_hosts: true
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:
-- start ttyS0
-- systemctl start getty@ttyS0.service
-- systemctl start rc-local
-- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
-- service ssh restart
-- service sshd restart
-- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
-- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
-users:
-- default
-- gecos: User configured by VIRL Configuration Engine 0.21.4
- lock-passwd: false
- name: cisco
- plain-text-passwd: cisco
- shell: /bin/bash
- ssh-authorized-keys:
- - VIRL-USER-SSH-PUBLIC-KEY
- - VIRL-USER-SSH-PUBLIC-KEY
- sudo: ALL=(ALL) NOPASSWD:ALL
-write_files:
-- path: /etc/init/ttyS0.conf
- owner: root:root
- content: |
- # ttyS0 - getty
- # This service maintains a getty on ttyS0 from the point the system is
- # started until it is shut down again.
- start on stopped rc or RUNLEVEL=[12345]
- stop on runlevel [!12345]
- respawn
- exec /sbin/getty -L 115200 ttyS0 vt102
- permissions: '0644'
-- path: /etc/systemd/system/dhclient@.service
- content: |
- [Unit]
- Description=Run dhclient on %i interface
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
- RemainAfterExit=yes
- owner: root:root
- permissions: '0644'
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- </extensions>
- <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]"/>
- <connection dst="/virl:topology/virl:node[3]/virl:interface[2]" src="/virl:topology/virl:node[2]/virl:interface[1]"/>
-</topology>
diff --git a/resources/tools/virl/topologies/simple-ring-nested.yaml b/resources/tools/virl/topologies/simple-ring-nested.yaml
deleted file mode 100644
index 094adf3988..0000000000
--- a/resources/tools/virl/topologies/simple-ring-nested.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-metadata:
- version: 0.1
- schema:
- - resources/topology_schemas/3_node_topology.sch.yaml
- - resources/topology_schemas/topology.sch.yaml
- tags: [hw, 3-node]
-
-nodes:
- TG:
- type: TG
- host: "{topology[tg1][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port3:
- mac_address: "{topology[tg1][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link1
- driver: virtio-pci
- port5:
- mac_address: "{topology[tg1][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link2
- driver: virtio-pci
- DUT1:
- type: DUT
- host: "{topology[sut1][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port3:
- mac_address: "{topology[sut1][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link3
- port1:
- mac_address: "{topology[sut1][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link1
- DUT2:
- type: DUT
- host: "{topology[sut2][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port1:
- mac_address: "{topology[sut2][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link2
- port3:
- mac_address: "{topology[sut2][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link3
diff --git a/resources/tools/virl/topologies/simple-ring.virl b/resources/tools/virl/topologies/simple-ring.virl
deleted file mode 100644
index 82973aa745..0000000000
--- a/resources/tools/virl/topologies/simple-ring.virl
+++ /dev/null
@@ -1,297 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<topology xmlns="http://www.cisco.com/VIRL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="0.9" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
- <extensions>
- <entry key="management_network" type="String">flat</entry>
- </extensions>
- <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="server-java">
- <extensions>
- <entry key="config" type="String">#cloud-config&#xD;
-bootcmd:&#xD;
-- ln -s -t /etc/rc.d /etc/rc.local&#xD;
-hostname: tg1&#xD;
-manage_etc_hosts: true&#xD;
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:&#xD;
-- start ttyS0&#xD;
-- systemctl start getty@ttyS0.service&#xD;
-- systemctl start rc-local&#xD;
-- touch /tmp/before-sed&#xD;
-- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config&#xD;
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
-- service ssh restart&#xD;
-- service sshd restart&#xD;
-users:&#xD;
-- default&#xD;
-- gecos: User configured by VIRL Configuration Engine 0.21.4&#xD;
- lock-passwd: false&#xD;
- name: cisco&#xD;
- plain-text-passwd: cisco&#xD;
- shell: /bin/bash&#xD;
- ssh-authorized-keys:&#xD;
- - VIRL-USER-SSH-PUBLIC-KEY&#xD;
- - VIRL-USER-SSH-PUBLIC-KEY&#xD;
- sudo: ALL=(ALL) NOPASSWD:ALL&#xD;
-write_files:&#xD;
-- path: /etc/init/ttyS0.conf&#xD;
- owner: root:root&#xD;
- content: |&#xD;
- # ttyS0 - getty&#xD;
- # This service maintains a getty on ttyS0 from the point the system is&#xD;
- # started until it is shut down again.&#xD;
- start on stopped rc or RUNLEVEL=[12345]&#xD;
- stop on runlevel [!12345]&#xD;
- respawn&#xD;
- exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
- permissions: '0644'&#xD;
-- path: /etc/systemd/system/dhclient@.service&#xD;
- content: |&#xD;
- [Unit]&#xD;
- Description=Run dhclient on %i interface&#xD;
- After=network.target&#xD;
- [Service]&#xD;
- Type=oneshot&#xD;
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
- RemainAfterExit=yes&#xD;
- owner: root:root&#xD;
- permissions: '0644'&#xD;
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- <entry key="Auto-generate config" type="Boolean">false</entry>
- </extensions>
- <interface id="0" name="eth1"/>
- <interface id="1" name="eth2"/>
- </node>
- <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="server-java">
- <extensions>
- <entry key="config" type="string">#cloud-config
-bootcmd:
-- ln -s -t /etc/rc.d /etc/rc.local
-hostname: sut1
-manage_etc_hosts: true
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:
-- start ttyS0
-- systemctl start getty@ttyS0.service
-- systemctl start rc-local
-- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
-- service ssh restart
-- service sshd restart
-- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
-- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
-users:
-- default
-- gecos: User configured by VIRL Configuration Engine 0.21.4
- lock-passwd: false
- name: cisco
- plain-text-passwd: cisco
- shell: /bin/bash
- ssh-authorized-keys:
- - VIRL-USER-SSH-PUBLIC-KEY
- - VIRL-USER-SSH-PUBLIC-KEY
- sudo: ALL=(ALL) NOPASSWD:ALL
-write_files:
-- path: /etc/init/ttyS0.conf
- owner: root:root
- content: |
- # ttyS0 - getty
- # This service maintains a getty on ttyS0 from the point the system is
- # started until it is shut down again.
- start on stopped rc or RUNLEVEL=[12345]
- stop on runlevel [!12345]
- respawn
- exec /sbin/getty -L 115200 ttyS0 vt102
- permissions: '0644'
-- path: /etc/systemd/system/dhclient@.service
- content: |
- [Unit]
- Description=Run dhclient on %i interface
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
- RemainAfterExit=yes
- owner: root:root
- permissions: '0644'
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- </extensions>
- <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>
- <entry key="config" type="string">#cloud-config
-bootcmd:
-- ln -s -t /etc/rc.d /etc/rc.local
-hostname: sut2
-manage_etc_hosts: true
-nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
-nfs_server_common: $$NFS_SERVER_COMMON$$
-runcmd:
-- start ttyS0
-- systemctl start getty@ttyS0.service
-- systemctl start rc-local
-- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
-- echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
-- service ssh restart
-- service sshd restart
-- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
-- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
-users:
-- default
-- gecos: User configured by VIRL Configuration Engine 0.21.4
- lock-passwd: false
- name: cisco
- plain-text-passwd: cisco
- shell: /bin/bash
- ssh-authorized-keys:
- - VIRL-USER-SSH-PUBLIC-KEY
- - VIRL-USER-SSH-PUBLIC-KEY
- sudo: ALL=(ALL) NOPASSWD:ALL
-write_files:
-- path: /etc/init/ttyS0.conf
- owner: root:root
- content: |
- # ttyS0 - getty
- # This service maintains a getty on ttyS0 from the point the system is
- # started until it is shut down again.
- start on stopped rc or RUNLEVEL=[12345]
- stop on runlevel [!12345]
- respawn
- exec /sbin/getty -L 115200 ttyS0 vt102
- permissions: '0644'
-- path: /etc/systemd/system/dhclient@.service
- content: |
- [Unit]
- Description=Run dhclient on %i interface
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
- RemainAfterExit=yes
- owner: root:root
- permissions: '0644'
-- path: /usr/local/sbin/cloud-instance-name
- content: |
- #!/usr/bin/python
- import pickle
- print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
- owner: root:root
- permissions: '0755'
-- path: /etc/rc.local&#xD;
- owner: root:root&#xD;
- permissions: '0755'&#xD;
- content: |-&#xD;
- #!/bin/sh&#xD;
- 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 }')
- nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
- instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '&lt;' | cut -f 1 -d '&gt;')
- echo My instance name is $instance_name
-
- MAXCOUNT=12
- RETRY=5
-
- mkdir -p /scratch
- mkdir -p /mnt/common
-
- echo "Mounting NFS directories"
- count=0
- while [ $count -lt $MAXCOUNT ] &amp;&amp; ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
- do
- sleep 5
- count=$[$count+1]
- done
-
- mount -t nfs "${nfs_server_common}" /mnt/common
-
- mkdir /scratch/$(hostname)
-
- exit 0&#xD;
-</entry>
- </extensions>
- <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]"/>
- <connection dst="/virl:topology/virl:node[3]/virl:interface[2]" src="/virl:topology/virl:node[2]/virl:interface[1]"/>
-</topology>
diff --git a/resources/tools/virl/topologies/simple-ring.yaml b/resources/tools/virl/topologies/simple-ring.yaml
deleted file mode 100644
index 094adf3988..0000000000
--- a/resources/tools/virl/topologies/simple-ring.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-metadata:
- version: 0.1
- schema:
- - resources/topology_schemas/3_node_topology.sch.yaml
- - resources/topology_schemas/topology.sch.yaml
- tags: [hw, 3-node]
-
-nodes:
- TG:
- type: TG
- host: "{topology[tg1][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port3:
- mac_address: "{topology[tg1][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link1
- driver: virtio-pci
- port5:
- mac_address: "{topology[tg1][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link2
- driver: virtio-pci
- DUT1:
- type: DUT
- host: "{topology[sut1][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port3:
- mac_address: "{topology[sut1][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link3
- port1:
- mac_address: "{topology[sut1][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link1
- DUT2:
- type: DUT
- host: "{topology[sut2][nic-management][ip-addr]}"
- port: 22
- username: cisco
- priv_key: |
-{priv_key}
- interfaces:
- port1:
- mac_address: "{topology[sut2][nic-0][hw-addr]}"
- pci_address: "0000:00:04.0"
- link: link2
- port3:
- mac_address: "{topology[sut2][nic-1][hw-addr]}"
- pci_address: "0000:00:05.0"
- link: link3