Commit 30f2802f authored by Iustin Pop's avatar Iustin Pop
Browse files

Add trivial tests for gnt-* cli



While testing some other stuff, I realised that the gnt-* commands
could be broken (as in, the script fails with syntax errors), but make
check doesn't detect it. Since we have shelltest, we can now add
trivial tests for this case.

One downside is that starting the scripts seems to be much slower
than the htools binaries, so we can't add as many tests.

The other downside is that shelltest is now required for all
development work, but I think this is a small disadvantage compared to
the increased testing possibilities.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 3c4afa2e
......@@ -768,6 +768,8 @@ TEST_FILES = \
test/data/vgs-missing-pvs-2.02.02.txt \
test/data/vgs-missing-pvs-2.02.66.txt \
test/import-export_unittest-helper \
test/gnt-cli.test \
test/ganeti-cli.test \
test/htools-balancing.test \
test/htools-basic.test \
test/htools-dynutil.test \
......@@ -857,6 +859,7 @@ dist_TESTS = \
test/daemon-util_unittest.bash \
test/ganeti-cleaner_unittest.bash \
test/import-export_unittest.bash \
test/cli-test.bash \
$(python_tests)
nodist_TESTS =
......@@ -872,8 +875,10 @@ TESTS = $(dist_TESTS) $(nodist_TESTS)
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) \
FAKEROOT=$(FAKEROOT_PATH) $(RUN_IN_TEMPDIR)
PYTHONPATH=. \
TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
$(RUN_IN_TEMPDIR)
# Environment for tests run by automake
TESTS_ENVIRONMENT = \
......@@ -906,6 +911,7 @@ srclink_files = \
test/daemon-util_unittest.bash \
test/ganeti-cleaner_unittest.bash \
test/import-export_unittest.bash \
test/cli-test.bash \
htools/offline-test.sh \
htools/cli-tests-defs.sh \
$(all_python_code) \
......
......@@ -86,6 +86,8 @@ echo OK
echo Running shelltest...
shelltest $SHELLTESTARGS ${TOP_SRCDIR:-.}/test/ -- --hide-successes
shelltest $SHELLTESTARGS \
${TOP_SRCDIR:-.}/test/htools-*.test \
-- --hide-successes
echo All OK
#!/bin/bash
export SCRIPTS=${TOP_BUILDDIR:-.}/scripts
export DAEMONS=${TOP_BUILDDIR:-.}/daemons
shelltest $SHELLTESTARGS \
${TOP_SRCDIR:-.}/test/gnt-*.test \
-- --hide-successes
# test the various gnt-commands for common options
$SCRIPTS/ganeti-masterd --help
>>>/Usage:/
>>>2
>>>= 0
$SCRIPTS/ganeti-masterd --version
>>>/^ganeti-/
>>>2
>>>= 0
$SCRIPTS/ganeti-noded --help
>>>/Usage:/
>>>2
>>>= 0
$SCRIPTS/ganeti-noded --version
>>>/^ganeti-/
>>>2
>>>= 0
$SCRIPTS/ganeti-rapi --help
>>>/Usage:/
>>>2
>>>= 0
$SCRIPTS/ganeti-rapi --version
>>>/^ganeti-/
>>>2
>>>= 0
$SCRIPTS/ganeti-watcher --help
>>>/Usage:/
>>>2
>>>= 0
$SCRIPTS/ganeti-watcher --version
>>>/^ganeti-/
>>>2
>>>= 0
# test the various gnt-commands for common options
$SCRIPTS/gnt-node --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-node --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-instance --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-instance --version
>>>/^gnt-instance/
>>>2
>>>= 0
$SCRIPTS/gnt-os --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-os --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-group --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-group --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-job --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-job --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-cluster --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-cluster --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-backup --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-backup --version
>>>/^gnt-/
>>>2
>>>= 0
$SCRIPTS/gnt-debug --help
>>>/Usage:/
>>>2
>>>= 1
$SCRIPTS/gnt-debug --version
>>>/^gnt-/
>>>2
>>>= 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment