Add an IPv6 check for the QA test of custom SSH ports
If any of the nodes involved would be reached through IPv6, the test isskipped. This is because the required testing setup using "iptables" issuiteble only for IPv4 and doesn't work for IPv6 connections....
Show running times of whole test blocks
Similarly to simple tests, test blocks are now demarcated (in boldface)and measured.
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Add more color options to QA
Allow combination of colors, background colors, bold, reverse video,etc.
Add more thorough check for terminal color support to QA
It uses `tput` to check if the current terminal has enough colors.
Add a simple QA test for a group with a custom SSH port
The test is turned on by setting `"group-custom-ssh-port": true` inthe config.
Unlike `"ssh-port": ...` in "options", this is a single test thatdoesn't affect the rest of the tests.
Signed-off-by: Petr Pudlak <pudlak@google.com>...
Export `NodeAdd` and `NodeRemove` from qa_node
This is needed for testing SSH ports so that we can remove a node froma group, add it to a group with a custom SSH port, and then undo thechange.
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Allow QA node acquisition and group creation using `with`
For acquiring nodes use `with AcquireManyNodes(num): ...`. The nodeswill be released automatically.For creating a new group use `with NewGroupCtx() as group: ...`. Thegroup will be removed automatically....
Update QA to test custom SSH ports
This patch adds the `ssh-port` option. If set to a non-standard port,the QA script sets up the default node group with this port, and beforerunning tests it adds `iptable` rules to all nodes so that the nodessee each other's SSH servers as running on this port....
Add QA tests for instance shutdown detection
Add QA tests for instance shutdown detection with Xen PVM and HVMhypervisors.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Remove hardcoded references to File, SharedFile templates
DTS_FILEBASED is a constant that exists and this commit makes surethat it is used whenever sensible, rather than resorting to hardcodingthe pair of templates in very many files.
Signed-off-by: Santi Raffa <rsanti@google.com>...
Add visual/color marks to the QA script
Add the function name to textual descriptions of tests
It makes it a bit easier to find the corresponding functions.
Signed-off-by: Petr Pudlak <pudlak@google.com>Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Merge branch 'stable-2.10' into master
Minor changes regarding hotplug support
Extend qa to test hotplug support
Only if default hypervisor is KVM try all hotplug related actions.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
QA: run all the instances during upgrade
The parameter 'upgrade-instances' was meant that one instance ofeach of these templates is left alive over the upgrade procedure.Threfore, breaking after the first suitable template is found isnot helpful.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Merge branch 'stable-2.9' into stable-2.10
Fix lint on qa_cluster.py
pep8 wants two blank lines after TestUpgrade. The previous commit gaveit one. This commit gives it the second.
Signed-off-by: Santi Raffa <rsanti@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix end-of-line whitespace
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Run the cluster upgrade test in qa, if enabled
The test is not run directly after the cluster related tests,but only after basic istance creation is verified, as this testalso creates instances.
Add QA routine to test 'gnt-cluster upgrade'
The subtle points of upgrading a cluster can only be found inQA, so add a method to do so. A prerequisite is, that bothversions are installed on the test cluster. To have a realisticscenario, instances are created on both versions....
QA: Factor out the list of available instance test
The knowledge about which instance creating tests areavailable is best kept in the module on istances. Moreover,it is not only used by RunInstanceTests, but willalso be needed by the upgrade test.
Merge branch 'stable-2.8' into stable-2.9
Verify that ConfD is running after master-failover
This patch adds additional 'gnt-node list' commands tothe testing of 'gnt-cluster master-failover' in order totest if ConfD (or LuxiD) is still running after amaster-failover.
Signed-off-by: Helga Velroyen <helgav@google.com>...
QA: remove subsumed QA test wrt disk templates
This patch removes a QA test that was supposed to testthat unused disk templates can be disabled safely. Thetest is now subsumed by unit tests and thus we remove ithere. Besides that, it was actually testing the wrong...
Use 'DTS_LVM' when possible
This patch replaces all usages of the utility function'GetLvmDiskTemplate' by the new 'DTS_LVM' constantto make it consistant with the usage of other DTS_*constants.
Additionally, it provides a unit tests to ensureconsistancy between DTS_LVM and the mapping of disk...
Fix indentation for newer lints
Newer versions of pylint are more strict regarding indentation rules. Thiscommit fixes a couple of indentations that they consider wrong.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Merge branch 'stable-2.9' into master
Hs2Py constants: update Python references
Update references to constants that were previously in the generated'lib/_autoconf.py' and since the previous patch have been included inthe Hs2Py constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Fix some wrong indentations in the code
Fix all instances of pep8's error: "E128 continuation line under-indented forvisual indent".
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix an improperly escaped string
Mark a string representing a "sed" command including a regular expression as araw string, so that the entire escaping is performed by "sed" itself.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Make QaConfig a proper container
Newer pylint versions complain that QaConfig is not a proper container becauseit does not implement the len(), delitem() and setitem() methods.This commit implements them.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Provide PYTHONPATH to burnin
One feature of the new private-module layout is that a pythonscript cannot simply 'import ganeti'. The reason is that theinterfaces to these modules are not stable and hence should notbe used outside Ganeti. However, this is what the burnin test...
Replace LD_* constants with DT_* constants
LD_* constants are basically like DT_* constants, exceptfor that both file and shared file were mapped to file.In order to not having to maintain three slightly differentsets of disk-related constants (DT, LD and ST), we merge...
QA: fix file storage QA wrt ipolicy
Ipolicy-allowed disk templates are now dependend on thecluster-wide enabled disk-templates. The QA for filestorage did not consider this updated logic so far.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
CLI: actually remove the --no-drbd-storage option
This removes the '--no-drbd-storage' option completelyfrom the command line interface. The hugepages designdoc still had a left-over reference to --no-lvm-storage,which is removed in this patch as well....
cluster init/modify: set helper without DRBD being enabled
The logic around the DRBD usermode helper so far was thatsetting it was only possible when DRDB was not explicitelydisabled. This patches changes it in a way that it isconsistent to how Ganeti handles the volume group name....
QA: adapt changes wrt DRBD usermode helper
This adjusts and extends the QA for 'gnt-cluster modify'with respect to the changes regarding the DRBDusermode helper.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add 'SF_NODE' to 'VALID_STORAGE_FIELDS'
Constant 'SF_NODE' is a storage field and, therefore, should be in'VALID_STORAGE_FIELDS'. This patch fixes this and also reference tothese constants, namely, in 'cmdlib' and 'qa'.
Remove storage field duplication in 'qa'
QA was adding 'SF_TYPE' to a list containing all storage fields (i.e.,'VALID_STORAGE_FIELDS'). However, 'SF_TYPE' is already part of'VALID_STORAGE_FIELDS', which means this element was occurring twicein the list....
QA: make ipolicy test respect enabled disk templates
This makes the 'gnt-cluster modify --ipolicy-*' testsrespect the enabled disk templates on the QA cluster.If the required disk templates are not enabled, thetest is skipped.
QA: adjust tests wrt to ipolicy disk templates
This adjusts the cluster QA with respect to the new checksbetween the ipolicy disk templates and the enabled disktemplates.
Use exact option name --enabled-disk-templates consistently
It is possible to use both, --enabled-disk-template(singular) or --enabled-disk-tempaltes (plural),but the usage of it has been documented and used in QAinconsistently. This is fixed by this patch now....
QA: skip lvm-based tests if lvm disabled
QA tests should make sure not to be run if the necessaryenvironment for them is not present. This patch fixes thatfor a couple of tests that fail to check that before beingexecuted.
QA: test for --{shared,}-file-storage-dir
This adds tests for 'gnt-cluster modify' wrt to theoptions --shared-file-storage-dir=... and--file-storage-dir. It also separates the two directories'specification in the QA configuration.
Rename VALID_STORAGE_TYPES to STORAGE_TYPES
For consistency, this patch renames 'VALID_STORAGE_TYPES'to 'STORAGE_TYPES', because the set of valid disktemplates is also just names 'DISK_TEMPLATES'.
Rename disk_template/storage_type map + cleanup
This patch renames the mapping of disk templates to storagetypes to MAP_DISK_TEMPLATE_STORAGE_TYPE, which is a moreexpressive name since it indicates that it is a mapping anddoes not have the inconsistent usage of singular and plural...
gnt-cluster {init, modify} --file-storage-dir
This patch implements consistent usage and behavior ofthe --file-storage-dir option in 'gnt-cluster init'and 'gnt-cluster modify'. It includes a bunch of unittests as well.
Additionally, it enables the previously written unit...
Prepare QA for shared file storage
This prepares the QA for running tests regardingshared file storage.
Rename queryd to luxid
As queryd will, in the future, handle all LUXI request, queue jobs andmost likely perform various other tasks, it is renamed to luxid already.This will safe some headache when upgrading Ganeti installations, as wedon't have to deal with a daemon rename....
Add ganeti-queryd to QA env test
Test for the newly introduces ganeti-queryd in the environment test ofQA.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Revert "Disable failing QA test"
This reverts commit b2525349f0da75c74432f2dd85abbcad56e56fed.
Issue 516 was fixed, so now the QA test can be re-enabled again.
QA: Adjust QA for file storage
This improves the QA code wrt to file storage in thefollowing ways:- It fixes a FIXME to make the file storage directory customizable in the QA config. Fallback is the default value.- It makes QA derive the enabled storage types from...
QA: Adjust test whether file storage is enabled
This patch fixes the node storage QA, which checked whetherfile storage is enabled by looking at the constant'ENABLE_FILE_STORAGE'. QA should rather retrieve thisinformation from the QA config.
Disable failing QA test
See issue 516 for an explanation of the problem, and why it was requiredto disable this test.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Disable enabled-template-test for exclusive storage
This patch disables the tests regarding enabled disktemplates for exclusive storage, because the semanticsthere are different and not covered in the test.
Revert "QA: Make Query tests test for '?' values"
This reverts commitbfbef99b9f056638411aa894e300aa095132e931. The problem is thatin some cases it makes sense for '?' to be displayed. Thisis the case for storage reporting on clusters that have onlythe 'diskless' disk template enabled. It would be nicer,...
Add QA test for verify-disks with broken DRBD
gnt-cluster verify-disks supports automatic activation of broken DRBDdisks. This new QA test verifies that it actually finds instances withbroken DRBD disks and activates the disks of those instances.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
QA: Make Query tests test for '?' values
When something goes wrong in the Haskell implementation ofqueries, the 'gnt-* list' command does not actually fail,but it just displays '?' as a sign of failure. We so fardo not test for that, which makes errors in the haskell...
Enable disk growth with exclusive storage
Disk growth is now supported also with exclusive storage, so we let theoperation continue.
Enable disk growth test in qa also with exclusive storage.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix lint error
Unset LV name if no LVM disk templates are enabled
If there are no LVM based disk templates enabled in QA, reset the LVname after the corresponding gnt-cluster modify tests. Otherwisegnt-cluster verify would complain about the missing volume group.
Also make sure that no disk templates requiring LVM are ever enabled...
Skip drbd-usermode-helper test if DRBD is disabled
Changing the drbd usermode helper in gnt-cluster modify fails if DRBD isnot installed on the nodes. Thus skip this test if DRBD is not in theset of enabled disk templates.
Replace tempfile by mktemp in QA code
The tempfile command only exists in Debian. In order to run the VClusterQA also on Fedora, replace its use by mktemp.
Merge branch 'stable-2.8' into master
Fix node modify QA tests for large cluster
If the node count in a cluster exceeds the master candidate pool size(which is 10 by default), it's no longer possible to remove the mastercandidate role from a node without passing --auto-promote (even with--force). This behavior is perfectly fine, but the TestModifyNode QA...
Merge branch 'stable-2.7' into stable-2.8
Fix daemon QA tests
TestInstanceConsecutiveFailures now leaves the test instance in the samestate it got it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Add gnt-node migrate to QA
Make it possible to optionally run gnt-node migrate during QA.
Skip Xen monitoring QA for non-Xen clusters
Instead of asserting that the Xen instance status collector fails fornon-Xen clusters just skip the test completely.Otherwise QA would fail for non-Xen hypervisors if Xen happens to beinstalled on the cluster as well....
Adapt VCluster script to current situation
vcluster-setup is adapted to the current Ganeti command line arguments.Also, a bug for diskless instances in qa_instance is fixed.
Merge branch 'stable-2.8' into 'master'
Export node spindles
Node spindles (queried live) are exported through the LUXI, RAPI, andiallocator interfaces.
Support RAPI QA on an already existing cluster
We support running most of the QA tests on an existing cluster. One bigexception was RAPI, as the credentials for the QA RAPI user were created atcluster setup. This patch allows to recover the password for the QA user...
Export instance disk spindles
Instance disk spindles can be queried via LUXI and RAPI, and are exportedthrough the allocator interface. This is a prerequisite for htools tohandle spindles.
The length of a RAPI query including all the instance fields now has become...
Spindles are mandatory with exclusive storage
If they are not specified in the command line an error is reported. Also,disk creation would fail without them.
QA has been updated.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix release of instances in QA
Also, fix some uses of keyword arguments for arguments with a defaultvalue, as required by the style guide, and a typo.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix missing "raise" in QA
The bug was introduced in 345d395d.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
QA for spindles in creating disks
"gnt-instance add" and "gnt-instance recreate-disks" are tested giving thenumber of spindles, when supported. Also, QA for "gnt-instancerecreate-disks" now covers the case where disks are resized.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Add QA for recreating single instance disks
So far QA only recreated the whole set of disks at once.
Add QA for gnt-instance modify --disk
Just a very basic test that adds and then removes a disk.
Monitoring QA: Remove superfluous import
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Non-Xen support for monitoring QA
The QA tests the Xen instance status collector, but that is expected to failwhen run on machines that do not use Xen.
Add QA for instance status collector
This commit introduces the QA for the instance status collector.
Begin the first QA for a monitoring-related component, the files and somefunctions are named after monitoring because they are meant to containfuture monitoring QAs as well....
QA: factor out some instance management functions
Some functions for managing instances will have to be used by new upcomingunit tests, so they are taken out of the instances QA file and put in a newutilities file accessible by other QA files as well....
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.
Merge remote-tracking branch 'origin/stable-2.8'
Conflicts: lib/bdev.py lib/cmdlib.py
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.
Cleanup DRBD 8.4 devices properly during QA
QA cleans up DRBD 8.4 devices via drbdsetup, which currently only workedfor DRBD 8.3. This (rather ugly) command makes sure that DRBD 8.4devices are cleaned up as well.
QA: Test multiple instance specs
The test of the interaction between policy and instances is extended.
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.
Make DEFAULT_ENABLED_DISK_TEMPLATES a list
This patch makes the constant DEFAULT_ENABLED_DISK_TEMPLATESa list instead of a set, because the order of the elements actually mattersas the first one is planned to be the default disk template for instancecreation. Also, this constant is always used like a list and thus providing it...