Remove WATCHER_STATEFILE constant
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
ganeti-watcher: Split for node groups
This patch brings a huge change to ganeti-watcher to make it aware ofnode groups. Each node group is processed in its own subprocess,reducing the impact of long-running operations.
The global watcher state file, $datadir/ganeti/watcher.data, is replaced...
Add new watcher constants
WATCHER_STATEFILE will be removed at the end of thispatch series.
Merge branch 'devel-2.4'
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add support for cluster/OS parameters in QA
Currently there is no way to QA with (for example) an initrd becausethe QA only inits the cluster with the default parameters. This makesit impossible to QA using anything but the default parameters, whichdoesn't always work....
Add a QA constant for cluster verify command
This seems to be used and reused multiple times, let's abstract it…
Fix QA OS API failure
The patch changing the OS api in QA to 20 was not complete, sorry.
QA: test using OS API v20
v20 is (mostly) a superset of the other versions, so testing with itshould be better than with V10. This detects properly the breakagefixed by the previous patch.
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Implement instance failover via RAPI
No idea why this was missed before.
Merge remote branch 'origin/devel-2.4'
Switch QA over to using instance stop --no-remember
Instead of hardcoded Xen commands. This will make it work for allhypervisors, instead of duplicating hypervisor functionality in QAitself.
The timeout has been removed as gnt-instance stop itself will make...
QA: Add tests for node group tags
QA: Adding a config option to disable cluster epo
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
QA: also run gnt-cluster repair-disk-sizes
So that we don't happen again to break this forever without realisingit.
The patch also replaces one ' with ".
QA: run the redist-conf command
This was (AFAICS) completely missing from the QA suite.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
gnt-instance migrate: Adding --allow-failover option
Fix QA breakage caused by 3fd7f6524
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
QA: Add tests for queries via RAPI
TLReplaceDisks: Add check if disks are activated
Previously we failed later with a rather useless error message. Thispatch fixes this and tells the user to activate-disks if replace-disksis in the need of activated disks rather than abort with a cryptic error...
QA: Improve tests for gnt-os
- Test OS lists via command line and RAPI- Test “gnt-os diagnose” and “gnt-os info”
QA: Add utility to ensure item is not in sequence
QA: Rename OS state test for clarification
Also add an additional check to ensure the OS does not exist.
QA: Use constants instead of hardcoded numbers
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...
gnt-cluster master-failover: Undrain queue
- Move functions for drain status (tracked via file) from jqueue to jstore- Undrain queue on master failover if necessary- Add QA test
gnt-instance reboot start instance if not yet started
This patch starts the instance when gnt-instance reboot is invoked on ainstance already stopped.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Introducing gnt-cluster epo
This is a convenience command to do an automated EPO in the possible limits ofGaneti.
TestRapiInstanceRename use instance name
Currently the QA rename job wrongly passed the whole info dict to theclient.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add QA rapi test for instance reinstall
This tests at least the basic case, unfortunately there is no way tocheck all possibilities using the provided rapi client, as that will usethe new method unless the cluster doesn't support it.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Remove force_master support from LUOobCommand
As per discussion on the man-page1 update, this functionality should beremoved and replaced by just give the command to run if the user insistsof power cycle/power off the master and refuse to operate.
[1] http://groups.google.com/group/ganeti-devel/browse_thread/thread/95d4879a747cc295...
Modify gnt-node power to support multiple nodes
This also has the sideeffect of presenting a table with the result
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....
Adding support for the new option flags in gnt-node power
Adding gnt-node health
Add RAPI resource for instance console
Small QA fixes: groups via RAPI, cluster OOB
Add “cluster-oob” to sample configuration file. Don't run RAPI grouptests if disabled.
Merge branch 'devel-2.3' into devel-2.4
Fix bug in “gnt-node list-storage”
LVM PV storage units would always show as allocatable, even when theyweren't. For some reason I have not been able to determine, the functionparsing the attributes (“_GetAllocatable”) was not even called and thelist opcode simply returned the attribute string as the value (e.g....
QA: replace ping with fping
This allows a lot of simplification in the TestIcmpPing, as fping cantake multiple arguments so we don't need anymore to create manycommands joined with &&.
QA: also run gnt-cluster verify-disks
The bug recently reported by Apollon Oikonomopoulos was missed becausewe don't test this command at all.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename OpPrepareExport and LUPrepareExport
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...
QA: Fix duplicated OOB tests
Patch f55312bd added the OOB tests to TestClusterVerify, which is notactually a test for cluster verify, but a runner for cluster verifythat is called multiple times, for each instance type, etc. This ledto running the OOB commands multiple times, which is painful...
Add QA tests for OpAssignGroupNodes
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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>...
qa_group.py: reimplement query tests with qa_utils
Now that group queries use query2 infrastructure, update the QA tests touse the generic functions in qa_utils.py.
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
QA: Remove 'oob_program=default' on gnt-cluster modify
On cluster level there's no 'default' because it's the highest cascadinglevel. Due to this 'default' is a valid value and doesn't mean to removethe value from the dict like it does on the other levels. To overcome...
QA: Adding new cluster verify cases
QA: Fix out-of-band tests
- Handle situations with no non-master node- Expand node name to make test work when configuration just has short names (e.g. “node1” instead of “node1.example.com”)
Fix QA for “list-fields” commands
The list of fields is not only sorted, but sorted in a nice way.
ganeti-qa: Wrap lines longer than 80 chars
Adapt QA for change in behaviour
As we can't test this on master anymore (if we flag the node offline wewould change master role on master) we use the first non master node wefind in the configuration
Merge branch 'devel-2.3'
Conflicts: lib/cmdlib.py: Trivial qa/ganeti-qa.py: Trivial...
QA: Run cluster-verify as part of all instance tests
“gnt-cluster verify” looks at some per-instance information as well, soit should be run for each instance type QA tests.
QA: Fix typo and add “not”
QA: Add some basic OOB tests
QA: Allow upload of string data
QA: Extend unittests for query operations, add tests for list-fields
More QA tests for group operations
This adds QA tests for the SetGroupParams operation, both for CLI andRAPI. Additionally, it adds tests for add/rename/remove groups via RAPI,which had not been included in a previous patch series. Finally, it alsotests setting "alloc_policy" (and, for the CLI, "ndparams") at group...
Add the "alloc_policy" attribute to node groups
This can be set at group creation time and via OpSetGroupParams. The defaultis "preferred", and existing node groups from previous Ganeti version willget the attribute set to this value.
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
qa: test same-name instance rename
Use the simplified command and rapi version to perform an instancerename to the same name. This is performed anytime the rename test isenabled, while the "other-name" rename is performed when also analternative name is provided....
Simplify instance rename qa test
The current instance rename qa testing function can only performback-and-forth renames, both for command line and rapi. In order to beable to perform same-name rename tests we change it to be able toperform simple renames, and then we change qa to call it to perform both...
Introduce constant for the name of the initial node group
Group operations: add QA tests for add/remove/rename
This is a single function that tests all of of the following:
- creating groups - creating groups that exist fails - renaming an empty group - renaming a group with nodes - renaming to a name that already exists fails...
Make rpc.call_lv_list() VG-aware
Changes to backend.GetVolumeList():- now accepts a list of VGs instead of one VG- returns LV names in the form "vg_name/lv_name"
Corresponding changes are done in: VerifyDisks, VerifyNode,LUCreateInstance (for both disk creation and adoption cases)...
Querying node groups: add QA tests
This adds QA tests for both CLI and RAPI.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Further cleanups on QA
This is more of an RFC. The patch attempts to address two issues:
- running conditional tests is ugly right now- we don't know what tests we skipped
By using the new RunTestIf, we solve both. But a significant number oftest decisions are more complex than just “is test enabled”, so those...
QA: Fix upload of RAPI users file
After moving the users file to a directory, we must ensure thedirectory exists.
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)...
QA: check that doubly modifying an OS state is OK
This would have prevented the bug fixed in the previous patch :(
Merge branch 'devel-2.2' into devel-2.3
Conflicts: lib/cmdlib.py (reverted & applied manually the change)
Signed-off-by: Iustin Pop <iustin@google.com>...
QA: add tests for gnt-cluster modify -B
QA: Run “gnt-cluster verify” while DRBD instance exists
This tests some parts of the disk information collection.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
QA: Test ssconf_instance_list file on rename and creation
This test would've caught the bug fixed in the previous patch.
Change qa_utils.ResolveInstanceName to take name
… instead of an object. Allows it to be used in places whereonly the name is available.
LUExportInstance: Accept instance already shut down
To remove the instance after an export it needs to be stopped. This canbe achived using the parameter “shutdown”, or by explicitly shuttingdown the instance before exporting. The latter would still require the...
QA: Allow job queue test to be disabled
On my machine it takes over 30 seconds, disabling it canspeed up the QA.
Fix QA mixup of node/instance tests
There are two node tests that are run from RunCommonInstanceTests, which is thebad place—it causes these node tests to be run three times instead of once.
QA RAPI: Test HTTP 404 and 501
This tests the HTTP Not Found and Not Implemented errors.
QA: Add test for “gnt-node modify”
Brown-bag fix for leftover comment
I did forgot this in the original patch. Sorry!!!!
Rework QA interaction with the watcher
The interaction with cron-launched watcher is a well-known failure mode of QA:
---- 2010-10-14 06:54:55.464839 time=0:00:56.764827 Test tools/move-instance
For the following tests it's recommended to turn off the ganeti-watcher cronjob....
Change QA log output
Currently, the logging in QA doesn't show the duration of the varioussteps, and if it is needed one has to perform log manipulation. Thispatch changes the output so that the log informatio is line based (asopposed to block-based), such that it's easy to grep for all log lines:...
Merge branch 'devel-2.2'
Try again to fix the inter-cluster move QA test
This time, we re-establish the old pri/sec nodes corretly. Unfortunately thiswill require now a 3-node cluster at least for drbd instances, hence it'ssomewhat suboptimal, but… The other option would be to move it simply from p:s...
Merge branch 'devel-2.2' into master
QA: Fix instance move tests
The instance move tests were moving the instance from node pair (A,_) to(B, A), and left it there. This patch makes sure that the first stepmoves the instance to (B,A) but the second one back to (A,B), so thatthe instance is left on the same primary node....
RAPI QA: Override MAC address when moving instance
This will make this test work again.
QA: Enable all tests by default
This patch enables all tests by default, unless when they'reexplicitely disabled in the config file. This will make surenewly added tests are run even when an old configuration fileis used.
A comment is also added qa-sample.json....
qa_config: Use ganeti.serializer for loading config
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add some trivial QA tests for the new OS states
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
QA: Test more tag operations via RAPI
This ensures tag operations work via RAPI. Also print requested URI tostdout for debugging.
qa_rapi: Fix indentation error
If no function to verify the result was specified, qa_rapi._DoTestswouldn't return the result.