Adding Vagrant file for cord-tester provisioning and dhcp test
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..1abd52c
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,35 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+
+ if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
+ config.vm.synced_folder ".", "/cord-tester", mount_options: ["dmode=700,fmode=600"]
+ else
+ config.vm.synced_folder ".", "/cord-tester"
+ end
+
+ config.vm.define "cordtest" do |d|
+ d.vm.box = "ubuntu/trusty64"
+ d.vm.hostname = "cordtest"
+ d.vm.network "private_network", ip: "10.100.198.202"
+ d.vm.provision :shell, path: "src/test/setup/prerequisites.sh"
+ d.vm.provider "virtualbox" do |v|
+ v.memory = 3000
+ end
+ end
+
+ config.vm.define "prod" do |d|
+ d.vm.box = "ubuntu/trusty64"
+ d.vm.hostname = "prod"
+ d.vm.network "private_network", ip: "10.100.198.203"
+ d.vm.provider "virtualbox" do |v|
+ v.memory = 2048
+ end
+ end
+
+ if Vagrant.has_plugin?("vagrant-cachier")
+ config.cache.scope = :box
+ end
+
+end
diff --git a/src/test/dhcp/dhcpTest.py b/src/test/dhcp/dhcpTest.py
index a8d7c7f..1b4f37d 100644
--- a/src/test/dhcp/dhcpTest.py
+++ b/src/test/dhcp/dhcpTest.py
@@ -361,18 +361,17 @@
log.info('Getting DHCP server Down.')
self.onos_ctrl.deactivate()
-
- for i in range (0,4):
- log.info('Checking DHCP request')
+
+ for i in range(0,4):
+ log.info("Sending DHCP Request.")
log.info('')
-
- cip, sip = self.dhcp.only_request(new_cip, mac)
-
- if cip == None and sip == None:
+ new_cip, new_sip = self.dhcp.only_request(cip, mac)
+ if new_cip == None and new_sip == None:
log.info('')
- log.info('DHCP request timed out. DHCP server is down')
- elif cip != None:
- break
+ log.info("DHCP Request timed out.")
+ elif new_cip and new_sip:
+ log.info("Got Reply from DHCP server.")
+ assert_equal(new_cip,None) #Neagtive Test Case
log.info('Getting DHCP server Up.')
@@ -380,20 +379,17 @@
assert_equal(status, True)
time.sleep(3)
- log.info('DHCP server is Up.')
-
- for i in range (0,4):
- log.info('Checking DHCP request')
+ for i in range(0,4):
+ log.info("Sending DHCP Request after DHCP server is up.")
log.info('')
-
- cip, sip, mac = self.dhcp.only_discover()
-
- if cip == None and sip == None and mac == None:
+ new_cip, new_sip = self.dhcp.only_request(cip, mac)
+ if new_cip == None and new_sip == None:
log.info('')
- log.info('DHCP request timed out.')
- elif cip != None:
- log.info('Got reply from DHCP server. DHCP server is down')
- break
+ log.info("DHCP Request timed out.")
+ elif new_cip and new_sip:
+ log.info("Got Reply from DHCP server.")
+ assert_equal(new_cip,None) #Neagtive Test Case
+