Add unittests for OpenvSwitch in LUNodeAdd
This patch adds node_unittest.py containing the framework for unittesting LUNodeAdd.At this point, only test setup and tests for OpenvSwitch areimplemented.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>...
Replace more IPs with reserved adresses
Recently, some IP addresses were changed to TEST-NETs from RFC 5737.This patch changes some more occurences of wrong IPs and replaces them.
TEST-NET-1 is used for primary_ips, TEST-NET-2 for networks and TEST-NET-3 for...
Mock RPC for unit tests
This patch enables patching the rpc module to create a mocked versionwhich can be used to mock a rpc.DnsOnlyRunner(). This is needed forunit testing LUNodeAdd, as it need to run RPCs against nodes not yetpresent in the configuration....
Fix example IPs and hostnames in tests
Our tests are a form of documentation, and hence should useIPs from the TEST-NET ranges according to RFC 5737. They definitelyshould not use real public IP addresses.
Similarly, example host names should be from one of the reserved...
Add unit test for LUInstanceQuery and -QueryData
This patch provides rudimentary unit test coverage for LUInstanceQueryand LUInstanceQueryData.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add unit tests for LUInstanceMigrate and -Failover
This patch adds rudimentary unit test coverage for LUInstanceMigrate andLUInstanceFailover.
Add unit tests for LUInstanceChangeGroup
This patch provides unit test coverage for LUInstanceChangeGroup.
Add unit tests for LUInstanceSetParams
This patch adds unit tests for LUInstanceSetParams. It does not provide100% coverage, but covers a significant portion.
Fix testMasterNetmask in TestLUClusterSetParams
The netmask was previously wrongly given as a bitmask, now it's given asthe net prefix length.
Merge branch 'stable-2.9' into master
cluster modify: deprecate --no-drbd-storage
As in the previous patch, the option '--no-drbd-storage'is deprectated, because it is subsumed by the non-inclusionof 'drbd' in the list of enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>...
cmdlib/cluster.py: unit tests for usermode helper
This patch factors out the functions that deal with settingand modifying the DRBD usermode helper in cluster.py inorder to make them more unittestable. The unit tests areprovided as well. No functional changes otherwise....
Adapt tests for merged changes in IPolicy handling
The enabled disk templates in IPolicies are stricter checked after themerge from 2.9, so adapt the tests to follow those changes.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add unit tests for LUInstanceMultiAlloc
This patch adds unit test coverage for LUInstanceMultiAlloc.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add unit test for LUInstanceRename
This patch adds unit test coverage for LUInstanceRename.
Add basic unit tests for instance import
This patch adds basic unit tests for instance import inLUInstanceCreate. It does not provide full coverage though.
Introduce GetMockLU and reduce use of _FakeLU
Introduce a new method of creating a mocked LU for tests, and reduce theuse of the legacy _FakeLU class.
Add unit tests for LUInstanceRemove and -Move
This patch adds unit test coverage for LUInstanceRemove andLUInstanceMove.
Add unit tests for LUInstanceCreate and move tests
- Move instance related tests to instance_unittest.py- Adapt moved tests to the new test framework where appropriate- Add unit test coverage for LUInstanceCreate - Only instance creation is covered yet, no imports...
Add unit test for LUGroupVerifyDisks
This patch adds unit test coverage for LUGroupVerifyDisks.
Add unit test for LUGroupEvacuate
This patch adds unit test coverage for LUGroupEvacuate.
Add unit tests for LUGroupRename
This patch adds unit test coverage for LUGroupRename.
Add unit tests for LUGroupRemove
This patch adds unit test coverage for LUGroupRemove.
Add unit tests for LUGroupSetParams
This adds unit test coverage for LUGroupSetParams.
Add unit test for LUGroupQuery
Provide unit test coverage for LUGroupQuery.
Add unit tests for LUGroupAssignNodes
Add unit test coverage for LUGroupAssignNodes, including the splitinstances check.
Add unit tests for LUGroupAdd
Provide unit test coverage for LUGroupAdd.
Move TestLUGroupAssignNodes to group_unittest.py
While moving the test, it is adapted to the new test framework.
Add test for LUClusterVerifyDisks
This LU only creates additional jobs as result, so this is a trivialunit test.
Extend unit tests for LUClusterVerifyGroup
- Add tests for additional Verify* methods- Converted test for VerifyFiles to the new test framework- Added possibility to prepare the LU in a test class before actually executing the test method with it
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Add possibility to access locked LU in tests
This features is useful to test (private) methods of LU's during tests,where those methods rely on the LU being completely initialized andlocking already performed.
An initial version of unit tests for LUClusterVerifyGroup makes use of...
Add test for LUClusterVerifyConfig
Add unit test covering LUClusterVerifyConfig.
Add test for LUClusterVerify
As this LU returns other jobs as result, submitting jobs from withinLU's is now mocked too.
Add unit test for LUClusterRename
Also mock the netutils and ssh module in order to test all code paths.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Add unit test for LUClusterRepairDiskSizes
Also add build method for easy building of disk objects to the testframework.
Introduce shortcut properties for config objects
Some configuration objects are accessed quite often, so introduceshortcut properties for those.
Add unit test for LUClusterSetParams
Some changes to the test framework were performed while writing thistest: - Extended builder for disks - Introduced builder for NICs - Fixed bugs in RpcResultsBuilder
Add unit test for LUClusterPostInit
Also extract common assertion logic for hook invocations toCmdlibTestCase.
Add unit test for LUClusterQuery
Unit-test LUClusterQuery. Some changes in the mocked clusterconfiguration are made, because the configuration was not completelyvalid before.
Add unit test for LUClusterRedistConf
Unit-test LUClusterRedistConf. Given the simplicity of the LU, this unittest only exercises the LU code.
Add unit tests for LUClusterDestroy
This patch adds unit test for the LUClusterDestroy Logical Unit.
Move cmdlib-related unittests to cmdlib/
ganeti.cmdlib_unittest.py andganeti.cmdlib.instance_storage_unittest.py are moved to thetest/py/cmdlib directory. Also, they are renamed to match the names inthis module.
Additionally, instance_storage_unittest.py was added to the makefile, so...
Move cluster-related unittest to cluster_unittest
cmdlib_unittest should still be split further, but at least the clusterrelated tests are moved to the proper file yet.
Add unit tests for LUClusterConfigQuery
Also, proper initialization of the runtime architecture information wasadded.
Add unit test for LUClusterDeactivateMasterIp
This patch adds unit tests for the LUClusterDeactivateMasterIp LogicalUnit.
Add unit test for LUClusterActivateMasterIp
In order to properly assert the called RPC method, eq is implementedon ConfigObject as well.
Add unit test for LUTestAllocator
Additionally to adding unit tests for LUTestAllocator, the testframework was adapted for its requirements.
Enable pylint and PEP8 for test support code
The test support code is mainly written from scratch, so in order toensure to keep the code quality high, enable pylint and PEP8 checksfor it.
Due to some specialities of the test code, a dedicate pylintrc-test file...
Initial version of cmdlib test framework
The initial version of the cmdlib test framework is able to execute LU'swith the following components mocked:
A base test class is provided which makes it easy to execute opcodes and...