This patch enables all tests by default, unless when they're explicitely disabled in the config file. This will make sure newly added tests are run even when an old configuration file is used.
Since JSON doesn't support comments, the dictionary key for disabled tests is prefix with a hash sign (#). This is already done for other commented out entries. Signed-off-by: Michael Hanselmann <[email protected]> --- qa/qa-sample.json | 79 +++++++++++++++++++++++++++++------------------------ qa/qa_config.py | 6 +++- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/qa/qa-sample.json b/qa/qa-sample.json index 5a5f279..74f1b5c 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -34,27 +34,30 @@ ], "tests": { - "env": true, - "os": true, - "tags": true, - "rapi": true, - - "create-cluster": true, - "cluster-verify": true, - "cluster-info": true, - "cluster-burnin": true, - "cluster-command": true, - "cluster-copyfile": true, - "cluster-master-failover": true, - "cluster-renew-crypto": true, - "cluster-destroy": true, - "cluster-rename": true, - "cluster-reserved-lvs": true, - - "node-info": true, - "node-volumes": true, - "node-readd": true, - "node-storage": true, + "# Tests enabled by default": null, + "#env": false, + "#os": false, + "#tags": false, + "#rapi": false, + + "# Tests enabled by default": null, + "#create-cluster": false, + "#cluster-verify": false, + "#cluster-info": false, + "#cluster-burnin": false, + "#cluster-command": false, + "#cluster-copyfile": false, + "#cluster-master-failover": false, + "#cluster-renew-crypto": false, + "#cluster-destroy": false, + "#cluster-rename": false, + "#cluster-reserved-lvs": false, + + "# Tests enabled by default": null, + "#node-info": false, + "#node-volumes": false, + "#node-readd": false, + "#node-storage": false, "# This test needs at least three nodes": null, "node-evacuate": false, @@ -62,23 +65,27 @@ "# This test needs at least two nodes": null, "node-failover": false, - "instance-add-plain-disk": true, - "instance-add-drbd-disk": true, - "instance-convert-disk": true, - + "# Tests enabled by default": null, + "#instance-add-plain-disk": true, + "#instance-add-drbd-disk": true, + "#instance-convert-disk": true, + + "# Tests enabled by default": null, + "#instance-export": false, + "#instance-failover": false, + "#instance-import": false, + "#instance-info": false, + "#instance-list": false, + "#instance-migrate": false, + "#instance-modify": false, + "#instance-reboot": false, + "#instance-reinstall": false, + "#instance-rename": false, + "#instance-shutdown": false, + + "# cron/ganeti-watcher should be disabled for these tests": null, "instance-automatic-restart": false, "instance-consecutive-failures": false, - "instance-export": true, - "instance-failover": true, - "instance-import": true, - "instance-info": true, - "instance-list": true, - "instance-migrate": true, - "instance-modify": true, - "instance-reboot": true, - "instance-reinstall": true, - "instance-rename": true, - "instance-shutdown": true, "# This test might fail with certain hypervisor types, depending": null, "# on whether they support the `gnt-instance console' command.": null, diff --git a/qa/qa_config.py b/qa/qa_config.py index 942be8b..20f3308 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -60,8 +60,10 @@ def get(name, default=None): def TestEnabled(test): - """Returns True if the given test is enabled.""" - return cfg.get('tests', {}).get(test, False) + """Returns True if the given test is enabled. + + """ + return cfg.get("tests", {}).get(test, True) def GetMasterNode(): -- 1.7.0.4
