History | View | Annotate | Download (24 kB)
Move message formatting functions to separate file
The formatting functions in qa_utils.py cannot be used by modulesimported there, such as qa_config. This patch factors the functioncalls into a separate file. Also reorders imports in touched files.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
QA: Handle multiple instance specs
Existing tests are updated to cope with the new instance specs format.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
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: Split function to set and parse instance policies
The main parts, moved to qa_util, will be used for node groups too.
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.
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).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
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....
Merge branch 'devel-2.7'
qa_utils: Fix order of arguments passed to _AssertRetCode
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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 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: Support entity objects in qa_utils._GetName
This is a temporary solution until nodes and instances are converted toobjects with attributes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
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: Added function to check cluster-verify result
Now it's possible to check that cluster-verify reports all the expectederrors, instead of simply checking that it fails.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Network QA
This adds a script for the QA of 'gnt-network'. So far itcovers adding/removing and connecting/disconnecting networks.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
QA: Factorize retrieving non-existent groups from config
Also add a check to make sure there are enough groups defined.
Remove some unused Python code
This patch removes code which is no longer used due to refactoring:
- http.InitSsl, last usage removed in commit 33231500 (“Convert RPC client to PycURL”)- rapi.baserlib.MakeParamsDict, last usage remove in commit 4e5a68f8...
Fixes and improvements to comments
Some fixes, added more information in a few points, removed a stale (5+year old) TODO comment.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
qa_utils: Stop hardcoding path to /etc/hosts
- Simplified shell command for adding hosts, too- The exception handling is also improved by re-raising any exceptions instead of swallowing qa_error.Error
QA: stop logging SSH arguments for each invocation
Currently, this is how the QA log looks like:
Command: ssh -oEscapeChar=none -oBatchMode=yes -l root -t -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes -oControlPath=/tmp/ganeti-qa-multiplexer.DMzkuH -oControlMaster=no node14 exit...
Switch QA to tty-less mode
This makes ssh generate much less noise when QA is run itself withouta tty, as otherwise we get thousands of lines of:
Pseudo-terminal will not be allocated because stdin is not a terminal.
in the QA logs (which are already big enough)....
qa_utils: Factorize code for getting entity name
This reduces code duplication and provides better error messages ifsomething is incorrect while getting a node or instance name.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
qa_utils: Accept string as instance for check
Some tests don't have access to an instance dictionary.
QA: Infrastructure for hook script to check instance status
This script can be used to check if an instance is running or stopped atvarious points during a QA run. Environment variables are used to passthe most essential information.
Convert listing exports to query2
This solves one case where locks are acquired during LUXI queries.Pretty late into the transition I noticed that OpBackupQuery had a“use_locking” parameter for a long time, but didn't use it. Sincemost of the other changes were already and this allows exports to...
Fix QA failures with "gnt-job list"
Jobs have no “name” field.
Fix wrong option names in QA and cluster-merge
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
QA: Add utility to ensure item is not in sequence
LUInstanceRename: Fail if renamed hostname mismatch
There's a problem if you run gnt-instance rename with a non FQDN and therenamed LU tries to resolve the hostname to make it FQDN. It could bethat this resolved hostname was just a CNAME to another name which leads...
Make it possible to disable tty in qa_utils.GetCommandOutput
The tty can have strange side effect as it seems to replace \n with\r\n. In case of simply catting a file and compare it's output thiswill break. This patch adds the possibility to disable tty if needed....
Run pylint over QA code too
Right now, the QA code is not covered by pylint, and this shows atleast one low-impact bug.
This patch does the necessary changes to make QA pylint-clean, and thechanges the makefile to run pylint for it.
Notable changes:...
QA: use a persistent SSH connection to the master
The recent additions to QA (many more tests) make QA slow if themachine on which the QA runs is not very close to the tested nodes —or in general, when the SSH handhaske is costly.
We discussed before about using a persistent connection, and here is...
Fix docstring for "cmd" in qa_utils.GetSSHCommand
Docstring indicated "cmd" should be a list, when it's expected thatit'll be a string.
Also, converted docstring to current epydoc-style list of functionarguments.
Signed-off-by: Adeodato Simo <dato@google.com>...
Fix QA for “list-fields” commands
The list of fields is not only sorted, but sorted in a nice way.
QA: Allow upload of string data
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
QA: Extend unittests for query operations, add tests for list-fields
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
QA: Improve tests for instance/node list
- Query all known fields- Random combinations (using a PRNG with a fixed seed) of fields- Order of result names
Simplify QA commands
Currently, 95% of the QA commands are executed in the same way: on themaster, based on a command list and with expectancies for succes:
AssertEqual(StartSSH(master['primary'], utils.ShellQuoteArgs(cmd)).wait(), 0)...
Change qa_utils.ResolveInstanceName to take name
… instead of an object. Allows it to be used in places whereonly the name is available.
qa_rapi: Test inter-cluster instance move script
This test moves an instance on the same cluster and, if successful,moves it back. While not testing a real move between two clusters,this is certainly better than nothing.
QA: Add function create temporary backup file
Adding QA RAPI tests for activate-disks and deactivate-disks calls
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
QA: Remove dry run mode
It didn't work as planned because some commands depend on the returnvalue or output of some operations.
Reviewed-by: iustinp
QA: Use pseudo-tty via SSH
This gives continous output instead it being buffered.
Reviewed-by: ultrotter
Copy qa_utils.AssertIn from 1.2 branch
Apparently it was forgotten when import the remote API QA tests.
Reviewed-by: schreiberal
Remove QA hook functionality
To my knowledge they're used nowhere and it's at least slightlyconfusing to people adding new QA checks.
Code style updates for QA code.
Add comment about PEP 318 to qa_utils.py.
List loading hooks in QA.
Implement hooks infrastructure.
Cleanup colouring functions.
Make the code somewhat smaller. Disable disk failure test for master for now.
Implement disk failure QA test.
Testing failure on the primary node is currently disabled due to drbd problems.
Don't take unused parameter in qa_utils.py:Print{Info,Error}.
Test “gnt-node evacuate” and “gnt-node failover” in QA.
Colours and warnings.
- Implement colours in qa_utils.- Print warning for cron script.
Enhance QA.
- Test “gnt-backup export” and “gnt-backup import”.- Move “ResolveInstanceName” to qa_utils.py.- Fix tests for “ganeti-watcher”.- Make instance shutdown and startup configurable.
Split QA script into different modules.