X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/fa337742cbb7e4984ee710e5f0254d14a2502d77..48aaca91efa214b37dba94f28582be73f3c90dbd:/test/ganeti.ovf_unittest.py diff --git a/test/ganeti.ovf_unittest.py b/test/ganeti.ovf_unittest.py old mode 100644 new mode 100755 index 5be3faf..bc72496 --- a/test/ganeti.ovf_unittest.py +++ b/test/ganeti.ovf_unittest.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -# Copyright (C) 2011 Google Inc. +# Copyright (C) 2011, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ from ganeti import constants from ganeti import errors from ganeti import ovf from ganeti import utils +from ganeti import pathutils import testutils @@ -58,6 +59,7 @@ GANETI_NETWORKS = { "nic0_ip": "none", "nic0_mac": "aa:00:00:d8:2c:1e", "nic0_link": "xen-br0", + "nic0_network": "auto", } GANETI_HYPERVISOR = { "hypervisor_name": "xen-pvm", @@ -90,6 +92,7 @@ VIRTUALBOX_NETWORKS = { "nic0_ip": "none", "nic0_link": "auto", "nic0_mac": "auto", + "nic0_network": "auto", } VIRTUALBOX_HYPERVISOR = {"hypervisor_name": "auto"} VIRTUALBOX_OS = {"os_name": None} @@ -129,6 +132,7 @@ CMDARGS_NETWORKS = { "nic0_ip": "none", "nic0_mac": "auto", "nic_count": "1", + "nic0_network": "auto", } CMDARGS_HYPERVISOR = { "hypervisor_name": "xen-pvm" @@ -206,7 +210,8 @@ EXP_DISKS_LIST = [ }, ] EXP_NETWORKS_LIST = [ - {"mac": "aa:00:00:d8:2c:1e", "ip":"None", "link":"br0","mode":"routed"}, + {"mac": "aa:00:00:d8:2c:1e", "ip":"None", "link":"br0", + "mode":"routed", "network": "test"}, ] EXP_PARTIAL_GANETI_DICT = { "hypervisor": {"name": "xen-kvm"}, @@ -215,16 +220,16 @@ EXP_PARTIAL_GANETI_DICT = { "version": "0", } EXP_GANETI_DICT = { - 'tags': None, - 'auto_balance': 'False', - 'hypervisor': { - 'root-path': '/dev/sda', - 'name': 'xen-pvm', - 'kernel_args': 'ro' + "tags": None, + "auto_balance": "False", + "hypervisor": { + "root-path": "/dev/sda", + "name": "xen-pvm", + "kernel_args": "ro" }, - 'version': '0', - 'disk_template': None, - 'os': {'name': 'lenny-image'} + "version": "0", + "disk_template": None, + "os": {"name": "lenny-image"} } EXP_NAME ="xen-dev-i1" EXP_VCPUS = 1 @@ -262,8 +267,8 @@ EXPORT_GANETI_INCOMPLETE = ("0" "Nic ovf:name=\"routed0\">routedaa:00:00:d8:2c:1eNone" - "br0" - "") + "br0test" + "") EXPORT_GANETI = ("0False" "lenny-image0routedaa:00:00:d8:2c:1eNonebr0" - "") + "test" + "") EXPORT_SYSTEM = ("" @@ -394,14 +400,14 @@ class TestOVFImporter(BetterUnitTest): def testOVAUnpackingDirectories(self): self.importer = ovf.OVFImporter(self.ova_package, OPTS_EMPTY) self.assertTrue(self.importer.input_dir != None) - self.assertEquals(self.importer.output_dir , constants.EXPORT_DIR) + self.assertEquals(self.importer.output_dir , pathutils.EXPORT_DIR) self.assertTrue(self.importer.temp_dir != None) def testOVFUnpackingDirectories(self): self.importer = ovf.OVFImporter(self.virtualbox_ovf, OPTS_EMPTY) self.assertEquals(self.importer.input_dir , _GetFullFilename("")) - self.assertEquals(self.importer.output_dir , constants.EXPORT_DIR) + self.assertEquals(self.importer.output_dir , pathutils.EXPORT_DIR) self.assertEquals(self.importer.temp_dir , None) def testOVFSetOutputDirDirectories(self):