1.1 --- a/OpenSecurity/bin/test_vmmanager.pyw Fri Sep 05 12:28:30 2014 +0100
1.2 +++ b/OpenSecurity/bin/test_vmmanager.pyw Thu Oct 02 13:08:09 2014 +0100
1.3 @@ -41,6 +41,7 @@
1.4 import cygwin
1.5 import vmmanager
1.6 import _winreg
1.7 +import time
1.8 gvm_mgr = None
1.9
1.10 class TestVMManager(unittest.TestCase):
1.11 @@ -54,6 +55,11 @@
1.12 gvm_mgr = vmmanager.VMManager.getInstance()
1.13 pass
1.14
1.15 + #@classmethod
1.16 + #def tearOffClass(self):
1.17 + # gvm_mgr.stop()
1.18 + # gvm_mgr.cleanup()
1.19 +
1.20 @unittest.skip("skipping")
1.21 def testGetTemplateUUID(self):
1.22 template = vmmanager.VMManager.getVDiskUUID(gvm_mgr.templateImage)
1.23 @@ -97,12 +103,9 @@
1.24 print re.search(r"(?<=http=)(?P<HttpProxy>.*?)(?=;)", text).groupdict()
1.25 print re.search(r"(?<=http=)(.*?)(?=;)", text)
1.26
1.27 - #@classmethod
1.28 - #def tearOffClass(self):
1.29 - # gvm_mgr.stop()
1.30 - # gvm_mgr.cleanup()
1.31
1.32
1.33 + @unittest.skip("skipping")
1.34 def testImportTemplate(self):
1.35 gvm_mgr.cleanup()
1.36 if 'SecurityDVM' in gvm_mgr.listVMS():
1.37 @@ -115,16 +118,8 @@
1.38 gvm_mgr.removeVMFolder('SecurityDVM')
1.39 gvm_mgr.importTemplate('C:\Windows\System32\config\systemprofile\VirtualBox VMs\OsecVM.ova')
1.40 gvm_mgr.updateTemplate()
1.41 - #VBoxManage list hostonlyifs
1.42 - #VBoxManage list dhcpservers
1.43 - #VBoxManage dhcpserver remove --netname "HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter"
1.44 - #VBoxManage dhcpserver add --ifname "VirtualBox Host-Only Ethernet Adapter" --ip 192.168.56.100 --netmask 255.255.255.0 --lowerip 192.168.56.101 --upperip 192.168.56.254 --enable
1.45 - #VBoxManage dhcpserver modify --ifname "VirtualBox Host-Only Ethernet Adapter" --enable
1.46 - #VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter" --dhcp
1.47 - #VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter" --ip 192.168.56.1 --netmask 255.255.255.0
1.48 -
1.49 -
1.50 -
1.51 +
1.52 + @unittest.skip("skipping")
1.53 def testHostOnlyDHCP(self):
1.54 #list hostonlyifs
1.55 #Cygwin.vboxExecute("list hostonlyifs")
1.56 @@ -135,12 +130,25 @@
1.57 dhcpservers = gvm_mgr.getDHCPServers()
1.58 print dhcpservers
1.59
1.60 + def testBrowsingRequest(self):
1.61 + gvm_mgr.start()
1.62 + gvm_mgr.handleBrowsingRequest()
1.63 + time.sleep(3000)
1.64 + pass
1.65 +
1.66 if __name__ == '__main__':
1.67 TestVMManager.setUpClass()
1.68
1.69 suite = unittest.TestLoader().loadTestsFromTestCase(TestVMManager)
1.70 unittest.TextTestRunner().run(suite)
1.71
1.72 + #VBoxManage list hostonlyifs
1.73 + #VBoxManage list dhcpservers
1.74 + #VBoxManage dhcpserver remove --netname "HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter"
1.75 + #VBoxManage dhcpserver add --ifname "VirtualBox Host-Only Ethernet Adapter" --ip 192.168.56.100 --netmask 255.255.255.0 --lowerip 192.168.56.101 --upperip 192.168.56.254 --enable
1.76 + #VBoxManage dhcpserver modify --ifname "VirtualBox Host-Only Ethernet Adapter" --enable
1.77 + #VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter" --dhcp
1.78 + #VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter" --ip 192.168.56.1 --netmask 255.255.255.0
1.79 # logger = setupLogger('Cygwin')
1.80 # c = Cygwin()
1.81 # unittest.main()