QA checks suitability for exclusive_storage tests
When instance tests with exclusive_storage are enabled, the number of PVson nodes are checked to see if it's suitable for those tests.
This fixes issue 437.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Disk templates are "allowed" and not "enabled" in ipolicies
The way disk templates were displayed in instance policies became confusingsince the introduction of the enabled_disk_templates cluster parameter.
Fix issue 440.
QA: Test multiple instance specs
The test of the interaction between policy and instances is extended.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
QA: Handle multiple instance specs
Existing tests are updated to cope with the new instance specs format.
QA: Transpose instance specs
The format used to store instance specs in QA is changed to better handlemultiple instance specs, a feature contained in the following patches.
QA: Update tests for new ipolicy specs command-line options
The old command-line options weren't working any more. Utility functionsare updated, and broken tests are removed (new tests are coming in thefollowing patches).
QA: Split function to set and parse instance policies
The main parts, moved to qa_util, will be used for node groups too.
QA: More tests for instance policies in groups
Instance policies are changed and checked for changes.
QA for --ipolicy-xxx-specs and show-ispecs-cmd
The tests check the interactions between the two commands.
Also refactored group QA code to separate tests about ipolicy, as thosetests are going to grow in complexity.
QA: Skip RAPI setup when RAPI is disabled
This is similar to 405692ef, reverted in aeefb4cd.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
QA: Fix error regarding missing names of disk configs
This fixes an error in case there are no disk names in the QA config(which was the case till recently). Right now, QA tries to use 'None'as disk name and that makes instance creation fail.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Revert "Make invocation of rapi test configurable ..."
This reverts commit 405692eff3d6f8400834f2df93d597bc7e4dd89f, because itbreaks QA.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Make invocation of rapi test configurable by QA config
This does not solve the underlying problem of the rapi test notbeing runnable locally, but it makes it at least configurableto avoid having to patch in/out all the time.
Update QA tests to check disk and NIC names
Modify existing tests to use the name option for instance disks. Theconfiguration options 'disk' and 'disk-growth' are merged into a single'disks' option, which is a list of dictionaries with 'size', 'growth' and...
QA: Test enabled disk templates with known configuration
The test failed because it was executed also in a configuration that wasn'texpected, i.e., with exclusive storage enabled.
Also the docstring is shortened, as it was being truncated in the QA output....
QA: Decision about disk templates to use is more modular
qa_config.IsTemplateSupported() is already used to decide which disktemplates are supported by QA. Enabled templates now are part of thatdecision.
Unit tests are updated.
QA: creating instances of dis/enabled disk templates
This patch makes sure that instance creation is only possiblefor instances that use enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
QA: dis/enabling of used disk templates
This extends the QA for 'gnt-cluster modify'. It ensuresthat disabling of a disk template is only possible if thecluster does not have any instances using the template.
qa_instance: refactoring wrt disk templates
This patch is a preparation for later patches in QA in this seriesit refactors the instance QA to make it more flexible regardingcreation of instances with different disk templates. Right now weonly support creation of instances with disk templates 'drbd', 'plain',...
QA: Test cluster init/modify wrt enabled disk templates
Fixes the QA of 'gnt-cluster init' and 'gnt-cluster modify' with respectto enabling disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtarara@google.com>
qa: fix TestInstanceModifyPrimaryAndBack flakiness
The test tries to scp the instance disks from the primary node to thenew destination, but connects to the master node instead. Thus it worksonly when the primary node is the master node. Fixing by correcting to...
qa: Fix mistake in _DestroyInstanceDisks
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
qa: fix instance recreate disks for ST_FILE disks
More lvm commands "sprinkled" in qa :/ We really have to factor them outin the storage layer, once we have a good one.
qa: skip gnt-backup for file instances
Note that this fixes the "current issue" but doesn't fix the underlyingproblem. :/
qa: fix RemoveInstanceOfflineNode for file-based
- The cleanup should only happen for non externally mirrored disk templates- It should behave differently for file and lvm based instances- It should definitely not be explicit in the qa file :/ (but it's...
qa: disable inter-cluster-instance-move for file
This actually hides a real issue that was discovered by enablingfile-based qa, so bug was filed for it. On the other hand it's betterthan keeping the qa broken, since this functionality was broken anyway....
qa: fix rename instance for non-lvm backed storage
The rename instance test performs an lvm-specific check for tags on theinstance volume. This should be in the future abstracted inside thetemplate class, and not explicitly called from qa.
This would allow other disks to perform the checks that make sense for...
qa: fix modify primary test
This test uses a non-existing config value "file-storage-dir" and fails.Fixing it by using the default value, which is currently what qa does.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
qa: pass some extra options to make scp work
scp by itself won't work on a cluster: a few extra options are needed totell it where to find the "right" ssh global known hosts file managed byGaneti.
gnt-node info uses a revised format
The code is more modular, and the output is YAML-compliant. QA has beenupdated to reflect the new format.
Add QA for gnt-instance modify --new-primary
Add a simple walk through the intended use case ofgnt-instance modify --new-primary for the disk templatefile. The tested scenario is shutting down an instance,manually moving the disk to the new node, setting the...
Additionally support disk-type file in QA
Also perform QA tests for the file disk template. The main reasonis that testing gnt-instance modify --new-primary requires amanual move of disks, which is most easily simulated for files.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Refactor ispecs in ipolicy structures
Minimum and maximum instance specs are put together into a single elementof the instance policy. This is in preparation for introducing multiplemin/max specs.
QA: Fix assertion
The assertion was always true because "all" was missing.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
gnt-instance info uses a revised format
The code is more modular and the output is YAML-compliant. QA updated totake advantage of it.
gnt-cluster info uses a revised format
The code is more modular and the output is YAML-compliant.
Added function in QA that uses PyYAML to parse the command output, and QAis updated to take advantage of it (instead of using lots of complicatedREs).
QA: Extend cluster QA wrt enabled storage types
This extends the QA scripts to test the changes in 'gnt-cluster init','gnt-cluster info', and 'gnt-cluster modify' with respect to enabledstorage types.
Add constants for storage types to constants.py
This patch adds the currently known and used storage methods to theconstants.py file. Note that storage types are different from disktemplates. For example both disk templates, drbd and plain, use lvmstorage types....
Fix QA: skip reinstall for diskless instances
Diskless instances cannot really be reinstalled, not even through RAPI.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.7'
Add QA for instance creation with policy violation
When instance policy is violated, creation fails.
Add QA for policy-instance interactions
Violations on policy changes are checked.
Add QA for cluster policies
qa_cluster.TestClusterSetISpecs() is exported as it will be used in futuretests.
Fix restoring default instance specs in group policies
"default" was not accepted as a valid input value for instance specs ingroup policies, due to a bug introduced in 2cc673a3e (and released with2.6.0). Added QA for this and another similar case.
Fix QA with disabled file storage
Currently QA tries to use “gnt-node list-storage” with all storagetypes, but when file storage is disabled this will fail.
The patch changes it so that if file storage is disabled, we test thatindeed fails, and otherwise we include it in the regular tests....
QA: Support diskless instances
This is an initial implementation of diskless instances.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
QA: Compare ipolicy directly with None
If a value was set to numeric 0, the parameter wouldn't be passed to thecommand.
QA: List all ipolicy options in example configuration
This makes it easier to know what options are available.
QA: Update assertion for diskless instances
QA: Disable reinstall test for diskless instances
QA: Fix dictionary formatting
Make it match the style guide.
QA: Disable drbd-offline test if no DRBD instance is used
If “instance-add-drbd-disk” is not enabled it usually also means to notuse DRBD at all.
QA: Disable RAPI tests for virtual clusters
The QA script connects to the RAPI daemon. In virtual cluster setups thedaemon is usually listening on a local interface not reachable from theoutside.
QA: Add virtual cluster support to queue drain test
The path to the queue drain file must use the virtual node path.
QA: Disable copyfile test for virtual clusters
This test will need some more work for virtual clusters. Disable it inthe meantime.
QA: Disable OOB tests for virtual clusters
They do not work properly at the moment.
QA: Update virtual node's RAPI users file
The file is located below the virtual node directory.
QA: Read virtual node's RAPI certificate
The virtual node prefix must be added to the path.
qa_os: Disable checks for virtual clusters
The OS definitions are not virtualized. Tests configuring different OSdefinitions on different nodes don't work properly.
qa_instance: Virtual cluster support for instance list
Use path of virtual node when retrieving ssconf's instance list.
qa_daemon: Virtual cluster support
Use virtual node path when removing the watcher status file.
qa_utils: Support virtual cluster for backup files
“qa_utils.BackupFile” is always called with the path for a normal node.In virtual clusters the node prefix path must be added.
qa_utils: Virtual cluster support for SSH commands
In virtual clusters, all “gnt-*” and “ganeti-*” commands requireenvironment variables to be set for the virtual cluster root directoryand node name. The “cmd” script generated by “vcluster-setup” is awrapper setting those variables....
qa_config: Support callable test checks
Until now all tests depended on simple AND/OR conditions. With theintroduction of virtual cluster support, some tests can only run ifvirtual clusters are not in use (e.g. not yet supported or notpossible). Instead of introducing more logic for enabling/disabling...
QA: Add config entries for virtual cluster
If these new options are set, a virtual cluster is created and used.Virtual clusters consist of 1..N virtual nodes on a single physical (orvirtual) node. The design of virtual clusters is described in“doc/design-virtual-clusters.rst”....
qa_config.AcquireNode: Use sort key function
Use a sort key function instead of using a comparing function (“cmp=…”).The latter is not supported in Python 3 and using a sort key function iseasier.
qa_config: Add repr for instance/node classes
Having a readable representation makes debugging easier.
QA: Add validation for cluster name
QA: Acquire instance via method
Also make “used” a property.
QA: Set disk template directly via instance object
Use a method on the instance object instead of going through“qa_config.GetInstanceTemplate”. This provides for better encapsulation.
Remove qa_config.GetInstanceNicMac
Call the wrapped instance method directly.
QA: Use constants for disk templates
Disk template names shouldn't be hardcoded.
Fix a merge issue in 3c296f56
Lines removed in devel-2.7 (250a9404) weren't removed in the merge withmaster.
QA: Support additional arguments for initialization
In some scenarios it can be useful to add more arguments to “gnt-clusterinit”, such as “--no-drbd-storage”, if DRBD is not installed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
qa_utils: Fix order of arguments passed to _AssertRetCode
QA: Remove dictionary-like interface from config objects
These are no longer used.
QA: Drop dictionary support from qa_utils._GetName
This is no longer needed now that instance/node objects in QA haveattributes. Use a helper function instead to retrieve an entity'sidentifying attribute.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
QA: Convert instances from items to attributes
The new objects support attributes. Item access (like a dictionary) isgoing away in a couple of patches.
QA: Convert nodes from items to attributes
The new objects support attributes, which are cleaner thandictionary-style access. Item access (like a dictionary) is going awayin a couple of patches. Also, pylint is better at checking attributesthan dictionary entries....
QA: Release nodes through method
Instead of having a module-level function in “qa_config” to release anode, a new method on node objects is used.
"exclusive_storage" cannot be changed on single nodes
There's never been support for a configuration where nodes in the same nodegroup have different values of the exclusive_storage flag. This patchdisables the possibility to change the flag for individual nodes....
QA: Convert nodes to objects
Up until now nodes were stored as a dictionary. The keys were hardcodedin a lot of places and entries modified directly.
This patch introduces a new class for nodes in QA named “_QaNode”. Itstill supports accessing details via dictionary syntax, but that will be...
QA: Release instances through method
Instead of having a module-level function in “qa_config” to release aninstance, a new method on instance objects is used.
QA: Convert instances to objects
Up until now instances were stored as a dictionary. The keys werehardcoded in a lot of places and entries modified directly.
This patch introduces a new class for instances in QA named“_QaInstance”. It still supports accessing details via dictionary...
QA: Release instance in ganeti-qa
Release instances directly from “ganeti-qa” instead of doing so in thethree tests removing instances. This is in line with how nodes arereleased and makes it easier to find and debug double-release issues.
QA: Stop using "in" operator for node
The new configuration object for nodes will not support it anymore.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
QA: Support entity objects in qa_utils._GetName
This is a temporary solution until nodes and instances are converted toobjects with attributes.
qa_config: Simplify IsTemplateSupported
The same code can be written in a single expression. The earlier patchnamed “Refactor storage of runtime exclusive storage flag in QA”provided the unit test.
Refactor storage of runtime exclusive storage flag in QA
This is a follow-up for “qa_config: Remove exclusive storage flag fromconfig”. Instead of storing the flag in a module-level variable it isnow stored within the new QA configuration class and unit tests are...
Refactor QA configuration code
Ever since its introduction (sometime before commit cec9845 in September2007), the QA configuration was stored in a dictionary at module-levelin “qa/qa_config.py”. The configuration was loaded, verified andevaluated using module-level functions. Since then the configuration has...
qa_config: Remove exclusive storage flag from config
Commit 6a0f22e added the ability to track the status of the cluster-wideflag for exclusive storage. It did so in a way which modifies thein-memory configuration dictionary. This patch changes the code to use a...
Redirect output for gnt-* list/list-fields commands
This enabled the redirection; QA output after this patch should becomemuch much smaller (on a 'quick' QA, we are left with ~0.5MB output onstdout and 64MB redirected output).
Signed-off-by: Iustin Pop <iustin@google.com>...
Add function to execute QA commands with redirected output
Some QA commands generate non-trivial output: for a full QA, the gnt-*list commands generate more than 300MB of data. To make the QA logsmore parseable by humans, we need support for redirecting output of...
Implement option to skip logging of QA commands
This patch adds an optional kwarg that allows skipping the "Command:…" line in QA output. This is helpful if we only need to run somemaintenance actions, that are QA-related and not Ganeti-related.
QA: Clean up after "instance-remove-drbd-offline" test
This test used to leave a node with orphan logical volumes and unused DRBDminors. Now, the expected leftovers are cleaned up after the test, andcluster-verify is run.
qa_config: Remove useless "options" variable
It is only used in one place and not necessary.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>