Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

[driver tests] Improve vmdk_ops test #832

Closed
5 tasks done
shuklanirdesh82 opened this issue Dec 21, 2016 · 1 comment
Closed
5 tasks done

[driver tests] Improve vmdk_ops test #832

shuklanirdesh82 opened this issue Dec 21, 2016 · 1 comment

Comments

@shuklanirdesh82
Copy link
Contributor

shuklanirdesh82 commented Dec 21, 2016

need to supply unique vm/tenant name for vmdk_ops_test

Following tests are failing because of reusing the same name for vm/tenant name

OTOMH few tasks:

  • getting rid off static value for vm name (e.g. vm_name = 'test-vm', tests_vmX)
  • need to improve tearDown() method to cleanup the created VMs
  • Need to improve following validation
        result = vmdk_ops.executeRequest(vm1_uuid, self.vm1_name, self.vm1_config_path, 'list', None, opts)
       
        self.assertEqual(3, len(result))
        self.assertEqual("tenant1_vol1", result[0]['Name'])
        self.assertEqual("tenant1_vol2", result[1]['Name'])
        self.assertEqual("tenant1_vol3", result[2]['Name'])
  • need to use vmdk_utils.get_datastores() instead of hardcoded value ('datastore1')
  • need to fix following code block as it is complaining when there is only one datastore in the inventory
               if len(datastores) >= 1:
 730                     datastore1 = datastores[1]
 731                     self.datastore1_name = datastore1[0]
 732                     self.datastoer1_path = datastore[2]

3 tests are failing locally consistently whereas 'testAttachDetach' passes if the created test-vm is not present in the inventory.

Running unit tests in /tmp/vmdk_ops_unittest3019/vmdk_ops_test.py...
..E.E........FF.
======================================================================
ERROR: testAttachDetach (__main__.VmdkAttachDetachTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vmdk_ops_unittest3019/vmdk_ops_test.py", line 531, in testAttachDetach
    vm=vm[0])
IndexError: list index out of range

======================================================================
ERROR: testBadOpts (__main__.VmdkCreateCloneRemoveTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vmdk_ops_unittest3019/vmdk_ops_test.py", line 272, in setUp
    path, err = vmdk_ops.get_vol_path(self.vm_datastore, auth.DEFAULT_TENANT)
  File "/tmp/vmdk_ops_unittest3019/vmdk_ops.py", line 638, in get_vol_path
    os.symlink(path, symlink_path)
OSError: [Errno 17] File exists

======================================================================
FAIL: test_vmdkops_on_different_tenants (__main__.VmdkTenantTestCase)
Test vmdkops on VMs which belong to different tenant
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vmdk_ops_unittest3019/vmdk_ops_test.py", line 1073, in test_vmdkops_on_different_tenants
    self.assertEqual("tenant1_vol1", result[0]['Name'])
AssertionError: 'tenant1_vol1' != 'tenant1_vol3'

======================================================================
FAIL: test_vmdkops_on_tenant_vm (__main__.VmdkTenantTestCase)
Test vmdk life cycle on a VM which belongs to a tenant
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vmdk_ops_unittest3019/vmdk_ops_test.py", line 958, in test_vmdkops_on_tenant_vm
    self.assertEqual("tenant1_vol2", result[0]['Name'])
AssertionError: 'tenant1_vol2' != 'tenant1_vol3'

----------------------------------------------------------------------
Ran 16 tests in 85.312s

FAILED (failures=2, errors=2)

//CC @kerneltime @ashahi1

@shuklanirdesh82
Copy link
Contributor Author

//CC @shaominchen @lipingxue (CC'ing them as they have run into the issue)

Please feel free to add more improvement if you have come across and not listed first comment.

Thanks!

@shuklanirdesh82 shuklanirdesh82 changed the title [driver tests] Test runs should be isolated in namespace [driver tests] Improve vmdk_ops test Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants