Extend QA with OS image
Extend QA with OS image tests for instance reinstall and instancemodify.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Clean up RunWithLocks
This patch cleans RunWithLocks up a little bit by reducing the numberof delay function terminations, and using the QAThread class to ensureexceptions are thrown at the right time and in the right place.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Add an exception-trapping thread class
To have better control over threads, this patch adds a helper Threadsubclass which captures any exceptions occurring for later use.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Wait for delay to provide interruption information
The RunWithLocks test assumed that gnt-debug delay would have the infoneeded for interruption ready immediately after being run, and in somesituations this is not the case. This patch makes the test more patient...
Add an expected block option to RunWithLocks
To compensate for the cases where a QA test is supposed to block whena lock is present, add an additional option showing whether blocking issupposed to happen or not.
Track if a QA test was blocked by locks
This patch adds threading to the RunWithTests function, allowing onethread to execute the QA test, and the other to monitor if it is beingblocked by locks set up during the test. If it is, terminate theblocking job, and let the QA continue, reporting the test failure at...
Add option to turn off command logging to GetCommandOutput
The command logging performed by GetCommandOutput can be distractingand unwelcome. This patch adds a switch allowing the command output tobe muted as needed.
Add an option for disabling the SSH multiplexer in QA
The SSH multiplexer is used by default in every connection made, andwhen multiple threads are used, this causes strange issues when runningthe QA locally. This patch allows the multiplexer to be bypassed,...
Add a RunWithLocks QA utility function
This patch adds a QA utility function that acquires a set of locks, andattempts to run a given function with the locks in place. Should thegiven function block, this function does not detect this - laterpatches will address the issue....
Sort imports in qa_rapi.py
This patch sorts the imports of qa_rapi.py to make things a little bitmore orderly.
Refactor move-instance QA test
The move-instance QA test will have to be changed in the followingpatches to allow testing opportunistic locking.
This patch retains the same functionality as before, but allows aniallocator to be used, and splits the move back and forth into two...
Merge branch 'stable-2.11' into master
Fix return of 'Validate'
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Increase the waiting time in gnt-job cancel test
The wait that is used for gnt-job cancel could cause flakiness if thewait is small enough for the job not to get canceled. This patchdoubles the waiting time - more than that is unfortunately probably abug....
Fix 'gnt-group add' output in QA
The command 'gnt-group add' might return a list of jobs, therefore, wecan print the job's output during the QA, in a way similar to that of'gnt-cluster verify', for example.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Extend 'AssertIn' with an optional error message
Extend 'AssertIn' with an optional error message, thus making iteasier to find the cause of an error when errors occur during the QA.
Add QA for instance communication with instance modify
Extend QA with tests related to feature that adds the instancecommunication mechanism to running instances, via 'gnt-instancemodify'.
Test node certificate renewal in QA
This extends the QA by explicitely testing the renewalof SSL client certificates.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Use node UUID as client certificate serial number
It turns out, that some implementations of OpenSSL are morepedantic in checking the certficates than others. In thisparticular case, the SSL connection could not beestablished when the serial number of the certificates...
Fix watcher tampering with instance userdown QA
The watcher was tampering with the instance user down QA because, whenthe watcher sees an instance marked an 'USER_down', it will cleanupthe instance, that is it will stop the instance, thus marking it as...
Instance communication mechanism QA (for cluster only)
Extend QA with tests for the instance communication mechanism. Thesetests cover only the cluster creating the instance communicationnetwork and connecting it to the existing node group, and also if new...
Fix bracket style in rapi-workload
Pep8 complained about bracket indentation. This fixes it to satisfy Pep8as well as our style guide.
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>(cherry-picked from ccded668c8a93fa25aaf21ddf5105270a04fe517)...
Merge branch 'stable-2.10' into stable-2.11
Fix 'UserDown' QA
Increase instance shutdown timeout and make call 'pkill' morereliable, which should fix the KVM QA.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Merge branch 'stable-2.9' into stable-2.10
Add QA tests for RAPI multi-instance allocation
The instance multi-allocation had no tests to detect its breakage, andthis patch fixes that.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Merge branch 'stable-2.8' into stable-2.9
Fix QA flakiness
The newly added job QA has some flakiness with respect to its use ofgnt-job watch. Fix this by waiting until the canceling status isreplaced with the canceled status, or a timeout is reached.
Linting fix: remove unused import
Add QA test for job cancellation
This patch introduces a QA test in which a job is cancelled whilewaiting.
QA for KVM instance shutdown
Add QA for instance shutdown for KVM.
Clean up epydoc comments
Add missing colons, and improve descriptions of parameters.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Use options for turning functionality on/off
Two command-line options are added: one for confirming that the testhas been started intentionally, and one for showing the methodinvocation output, which is useful, but not always needed.
Add job cancellation workload
To examine if jobs can be cancelled correctly, provide workload relatedto this as well.
Add cluster parameter change workload
One of the few leftover unused RAPI methods is the cluster modifymethod. This patch tests it by setting and unsetting various safevalues.
Make an instance move workload that works in 2.6
The instance move workload present before this patch works on 2.11, butfails on 2.6. The 2.11 workload will still be useful should any laterversion of Ganeti use it as reference, but a 2.6 workload has to be...
Add instance move workload
Through the use of functions provided by the rapi QA, all the requestsrelated to instance moves can be exercised.
Allow the skipping of checks for inter-cluster move test
The inter-cluster instance move test is very interesting for the RAPIcompatibility tests, as it uses many RAPI requests that are otherwisehard to exercise. It uses no command-line functionality apart from...
Make the finish function return the error status explicitly
The earlier version of the Finish function assumed that checking if thevalue of the response is None would suffice to check if any errors haveoccurred. This is not, and this patch adjusts the function to expose...
Add migration and failover workload
This patch introduces additional calls adding migration and failoverRAPI operations, moving a DRBD-disk template instance between nodes.
Add tracking of used client methods
As a helper or a warning to anyone extending the RAPI client, theclient wrapper now warns of unused methods or method arguments.
Add network workload
This patch exercises the network RAPI commands.
Add miniature query filtering workload
As query filtering was not a part of the previous workloads, this patchadds a single example of its use.
Add per-resource query workload
The query requests are done to receive data about a certain resourcetype. With tests for all the resources barring networks in place, thequery workloads can be added at the point where the existence of enoughresources in the system can be confirmed, making the results of the...
Add group-related workload
This patch further extends the RAPI workload by exercising all thegroup-related functionality.
Add node-related workload
This patch further expands the workload by performing various nodeoperations.
Add warning about the RecreateInstanceDisks invocation
A test relying on RAPI alone cannot exercise the RecreateInstanceDisksfunctionality properly - simply because it cannot damage an instanceto the point where its disks would be missing and in need of...
Add various single instance operations
To further expand the number of RAPI methods in the workload, thesingle instance operations are added in this patch. An instance iscreated, deleted, shutdown, restarted, reinstalled, renamed, andhas its disks activated and deactivated and grown....
Add tag method testing
This patch adds a generic way to test tagging of various entities viaRAPI. More tags testing will be added as other entitt tests are added.
Add helper function that waits for jobs to finish
Some RAPI calls result in the creation of a long-running job,returning a job id to be used to extract the results later. To reducethe amount of boilerplate, introduce a simple function to do thewaiting....
Add simple retrieval operations to workload
This patch expands the RAPI workload with simple Get* commands.
Add the first version of the RAPI workload script
The RAPI workload script supplies work for the RAPI compatibilitytests. The initial version does very little, but can be expandedas needed.
Make the qa_rapi setup method return the RAPI client
Move RAPI secret lookup to qa_rapi
The RAPI secret lookup is a helper function used by the Ganeti QA toretrieve the RAPI password of an already setup cluster. As this couldbe useful to other utilities performing QA, move it to the qa_rapimodule.
Catch exceptions when calling curses.setupterm() in QA
If it's running on a non-standard terminal, such asrxvt-unicode-256color, the call fails with an exception. Instead, catchthe exception and proceed without coloring warnings/errors.
Signed-off-by: Petr Pudlak <pudlak@google.com>...
Fix types for queries in QA
Due to the actual implementation of the '?' operatorin our query language, it happily accepted essentiallyany value that was not 0 or False as being true. However,it was always only specified to work on boolean values.Therefore, our QA shouldn't test for this unspecified...
Gluster: add the Shared File storage type
The shared file and gluster disk templates should not report their diskspace information like file does, because they do not behave the same.
If a cluster pulls from the same, shared source of storage then it is...
gnt-cluster verify: demote orphan volume error to warning
Ganeti checks for orphan volume by making sure that it knows about allvolumes on disk; any additional orphan volume, even if created by theadministrator, causes a failure in gnt-cluster verify. Given that...
Add network tag tests to QA
The QA did not have a test for network tags until now, and this patchremedies the situation.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Activate QA for rapi queries via luxi
This patch enables QA testing for rapi queries for thenewly transformed queries from python to haskell(groups, instances, nodes, export, and networks). So far,the QA did not distinguish between resources that cannot be...
Use the generic query field test for network QA
Instead of just using sporadic 'gnt-network list' commands,use the more exhaustive generic query test functions forlist and list-fields.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Add gnt-network list to network QA
The QA for networks so far did not cover network queriesand as such issues with those could not be discovered.
Add patching QA configuration files on buildbots
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.
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.
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.
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>...
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.
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