Added No option intents
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 57d8c9b..6a31a60 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1,3 +1,4 @@
+
#!/usr/bin/env python
"""
Created on 26-Oct-2012
@@ -1189,7 +1190,7 @@
return main.TRUE
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
- main.log.error( self.name + ": " + self.handle.before )
+ main.log.error(self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
@@ -2010,6 +2011,64 @@
main.cleanup()
main.exit()
+ def assignVLAN( self, host, intf, vlan):
+ """
+ Add vlan tag to a host.
+ Dependencies:
+ This class depends on the "vlan" package
+ $ sudo apt-get install vlan
+ Configuration:
+ Load the 8021q module into the kernel
+ $sudo modprobe 8021q
+
+ To make this setup permanent:
+ $ sudo su -c 'echo "8021q" >> /etc/modules'
+ """
+ if self.handle:
+ try:
+ # get the ip address of the host
+ main.log.info("Get the ip address of the host")
+ ipaddr = self.getIPAddress(host)
+ print repr(ipaddr)
+
+ # remove IP from interface intf
+ # Ex: h1 ifconfig h1-eth0 inet 0
+ main.log.info("Remove IP from interface ")
+ cmd2 = host + " ifconfig " + intf + " " + " inet 0 "
+ self.handle.sendline( cmd2 )
+ self.handle.expect( "mininet>" )
+ response = self.handle.before
+ main.log.info ( "====> %s ", response)
+
+
+ # create VLAN interface
+ # Ex: h1 vconfig add h1-eth0 100
+ main.log.info("Create Vlan")
+ cmd3 = host + " vconfig add " + intf + " " + vlan
+ self.handle.sendline( cmd3 )
+ self.handle.expect( "mininet>" )
+ response = self.handle.before
+ main.log.info( "====> %s ", response )
+
+ # assign the host's IP to the VLAN interface
+ # Ex: h1 ifconfig h1-eth0.100 inet 10.0.0.1
+ main.log.info("Assign the host IP to the vlan interface")
+ vintf = intf + "." + vlan
+ cmd4 = host + " ifconfig " + vintf + " " + " inet " + ipaddr
+ self.handle.sendline( cmd4 )
+ self.handle.expect( "mininet>" )
+ response = self.handle.before
+ main.log.info ( "====> %s ", response)
+
+
+ return main.TRUE
+ except pexpect.EOF:
+ main.log.error( self.name + ": EOF exception found" )
+ main.log.error( self.name + ": " + self.handle.before )
+ return main.FALSE
+
if __name__ != "__main__":
import sys
sys.modules[ __name__ ] = MininetCliDriver()
+
+
diff --git a/TestON/tests/FuncIntent/FuncIntent.py b/TestON/tests/FuncIntent/FuncIntent.py
index d1bd053..ace4e65 100644
--- a/TestON/tests/FuncIntent/FuncIntent.py
+++ b/TestON/tests/FuncIntent/FuncIntent.py
@@ -353,6 +353,37 @@
" successful",
onfail="1HOP: Add host intent failed" )
+ main.step( "VLAN1: Add vlan host intents between h4 and h12" )
+ stepResult = main.wrapper.hostIntent( main,
+ name='VLAN1',
+ host1='h4',
+ host2='h12',
+ host1Id='00:00:00:00:00:04/100',
+ host2Id='00:00:00:00:00:0C/100',
+ sw1='s5',
+ sw2='s2',
+ expectedLink=18 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="VLAN1: Add vlan host intent successful",
+ onfail="VLAN1: Add vlan host intent failed" )
+ stepResult = main.TRUE
+ main.step( "VLAN2: Add inter vlan host intents between h13 and h20" )
+ stepResult = main.wrapper.hostIntent( main,
+ name='VLAN2',
+ host1='h13',
+ host2='h20',
+ host1Id='',
+ host2Id='',
+ sw1='s5',
+ sw2='s2',
+ expectedLink=18 )
+
+ utilities.assert_equals( expect=main.FALSE,
+ actual=stepResult,
+ onpass="VLAN2: Add inter vlan host intent successful",
+ onfail="VLAN2: Add inter vlan host intent failed" )
def CASE1002( self, main ):
"""