cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

tests should only run when applicable for adv-sg zone in such env

Open DaanHoogland opened this issue 2 years ago • 4 comments

ISSUE TYPE
  • Documentation Report
  • testing/CI
COMPONENT NAME
marvin
CLOUDSTACK VERSION
4.18
CONFIGURATION
advanced zone with security groups.
OS / ENVIRONMENT
SUMMARY

when an advanced zone with security groups is used to test for regressions, a lot of errors occur. an example

ERROR: test suite for <class 'tests.smoke.test_router_dns.TestRouterDns'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nose/suite.py", line 210, in run
    self.setUp()
  File "/usr/local/lib/python3.6/site-packages/nose/suite.py", line 293, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python3.6/site-packages/nose/suite.py", line 316, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python3.6/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/marvin/tests/smoke/test_router_dns.py", line 92, in setUpClass
    zoneid=cls.zone.id)
  File "/usr/local/lib/python3.6/site-packages/marvin/lib/base.py", line 3562, in create
    return Network(apiclient.createNetwork(cmd).__dict__)
  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 2981, in createNetwork
    response = self.connection.marvinRequest(command, response_type=response, method=method)
  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 381, in marvinRequest
    raise e
  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 376, in marvinRequest
    raise self.__lastError
  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 310, in __parseAndGetResponse
    response_cls)
  File "/usr/local/lib/python3.6/site-packages/marvin/jsonHelper.py", line 155, in getResultObj
    raise cloudstackException.CloudstackAPIException(respname, errMsg)
marvin.cloudstackException.CloudstackAPIException: Execute cmd: createnetwork failed, due to: errorCode: 431, errorText:Only shared guest network can be created in security group enabled zone

this is not necessary as we know beforehand that these tests will fail. Tests need to be properly tagged to not run in these environments.

STEPS TO REPRODUCE

EXPECTED RESULTS
test will not run
ACTUAL RESULTS
test runs and fails

DaanHoogland avatar Feb 01 '23 10:02 DaanHoogland

good start ! @DaanHoogland

weizhouapache avatar Feb 01 '23 10:02 weizhouapache

I would love to handle this issue. Can you assign this issue to me.

lak7 avatar Feb 03 '23 07:02 lak7

go ahead @lak7 , create a PR and we'll go from there. Note however that creating a test environment with an advanced zone with security groups and a marvin test environment in no small feat if you are new to the project.

DaanHoogland avatar Feb 03 '23 08:02 DaanHoogland

Thanks! I will try my best.

lak7 avatar Feb 03 '23 08:02 lak7

@lak7 I am unassigning you . please feel free to pick up when ready anyway

DaanHoogland avatar Jun 05 '24 12:06 DaanHoogland