[libvirt] [PATCH 0/5] tests: misc cleanups

A collection of misc cleanups to the test suite. They apply on top of my config file fix here: http://www.redhat.com/archives/libvir-list/2016-April/msg01515.html Cole Robinson (5): tests: build: Remove duplicate libvirtd test list tests: consistently name virsh tests with 'virsh-' prefix tests: rename test_conf -> virconftest tests: consistently source test-lib.sh in scripts tests: remove 'reconnect' and 'statstest' cfg.mk | 2 +- tests/Makefile.am | 64 +++---- tests/capabilityschematest | 3 +- tests/domaincapsschematest | 3 +- tests/domainschematest | 3 +- tests/domainsnapshotschematest | 3 +- tests/interfaceschematest | 3 +- tests/libvirtd-fail | 6 +- tests/libvirtd-pool | 6 +- tests/networkschematest | 3 +- tests/nodedevschematest | 3 +- tests/nwfilterschematest | 3 +- tests/reconnect.c | 71 ------- tests/secretschematest | 3 +- tests/statstest.c | 210 --------------------- tests/storagepoolschematest | 3 +- tests/storagevolschematest | 3 +- tests/{confdata => virconfdata}/fc4.conf | 0 tests/{confdata => virconfdata}/fc4.out | 0 tests/{confdata => virconfdata}/libvirtd.conf | 0 tests/{confdata => virconfdata}/libvirtd.out | 0 tests/{confdata => virconfdata}/no-newline.conf | 0 tests/{confdata => virconfdata}/no-newline.out | 0 tests/{test_conf.c => virconftest.c} | 0 tests/{test_conf.sh => virconftest.sh} | 4 +- tests/virsh-all | 4 +- tests/{cpuset => virsh-cpuset} | 6 +- ...fine-dev-segfault => virsh-define-dev-segfault} | 6 +- tests/{int-overflow => virsh-int-overflow} | 6 +- tests/virsh-optparse | 6 +- tests/{read-bufsiz => virsh-read-bufsiz} | 6 +- .../{read-non-seekable => virsh-read-non-seekable} | 6 +- tests/virsh-schedinfo | 6 +- tests/{start => virsh-start} | 6 +- tests/virsh-synopsis | 6 +- tests/virsh-undefine | 6 +- tests/virsh-uriprecedence | 3 +- tests/{vcpupin => virsh-vcpupin} | 6 +- 38 files changed, 49 insertions(+), 420 deletions(-) delete mode 100644 tests/reconnect.c delete mode 100644 tests/statstest.c rename tests/{confdata => virconfdata}/fc4.conf (100%) rename tests/{confdata => virconfdata}/fc4.out (100%) rename tests/{confdata => virconfdata}/libvirtd.conf (100%) rename tests/{confdata => virconfdata}/libvirtd.out (100%) rename tests/{confdata => virconfdata}/no-newline.conf (100%) rename tests/{confdata => virconfdata}/no-newline.out (100%) rename tests/{test_conf.c => virconftest.c} (100%) rename tests/{test_conf.sh => virconftest.sh} (88%) rename tests/{cpuset => virsh-cpuset} (89%) rename tests/{define-dev-segfault => virsh-define-dev-segfault} (90%) rename tests/{int-overflow => virsh-int-overflow} (74%) rename tests/{read-bufsiz => virsh-read-bufsiz} (90%) rename tests/{read-non-seekable => virsh-read-non-seekable} (89%) rename tests/{start => virsh-start} (86%) rename tests/{vcpupin => virsh-vcpupin} (94%) -- 2.7.3

Store the test list in libvirtd_test_scripts, and use it where appropriate. This also fixes the fact that we didn't ship virsh-uriprecedence when libvirtd build is disabled. --- tests/Makefile.am | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index db4f88b..b32435d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -367,8 +367,7 @@ test_scripts = \ domainsnapshotschematest \ secretschematest -if WITH_LIBVIRTD -test_scripts += \ +libvirtd_test_scripts = \ test_conf.sh \ cpuset \ define-dev-segfault \ @@ -387,27 +386,14 @@ test_scripts += \ virsh-undefine \ $(NULL) +if WITH_LIBVIRTD +test_scripts += $(libvirtd_test_scripts) + test_programs += \ eventtest \ libvirtdconftest else ! WITH_LIBVIRTD -EXTRA_DIST += \ - test_conf.sh \ - cpuset \ - define-dev-segfault \ - int-overflow \ - libvirtd-fail \ - libvirtd-pool \ - read-bufsiz \ - read-non-seekable \ - start \ - vcpupin \ - virsh-all \ - virsh-optparse \ - virsh-schedinfo \ - virsh-synopsis \ - virsh-undefine \ - $(NULL) +EXTRA_DIST += $(libvirtd_test_scripts) endif ! WITH_LIBVIRTD test_programs += objecteventtest -- 2.7.3

On 04/21/2016 01:50 PM, Cole Robinson wrote:
Store the test list in libvirtd_test_scripts, and use it where appropriate. This also fixes the fact that we didn't ship virsh-uriprecedence when libvirtd build is disabled. --- tests/Makefile.am | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am index db4f88b..b32435d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -367,8 +367,7 @@ test_scripts = \ domainsnapshotschematest \ secretschematest
-if WITH_LIBVIRTD -test_scripts += \ +libvirtd_test_scripts = \ test_conf.sh \ cpuset \ define-dev-segfault \ @@ -387,27 +386,14 @@ test_scripts += \ virsh-undefine \ $(NULL)
+if WITH_LIBVIRTD +test_scripts += $(libvirtd_test_scripts) + test_programs += \ eventtest \ libvirtdconftest else ! WITH_LIBVIRTD -EXTRA_DIST += \ - test_conf.sh \ - cpuset \ - define-dev-segfault \ - int-overflow \ - libvirtd-fail \ - libvirtd-pool \ - read-bufsiz \ - read-non-seekable \ - start \ - vcpupin \ - virsh-all \ - virsh-optparse \ - virsh-schedinfo \ - virsh-synopsis \ - virsh-undefine \ - $(NULL) +EXTRA_DIST += $(libvirtd_test_scripts) endif ! WITH_LIBVIRTD
test_programs += objecteventtest
ACK

--- tests/Makefile.am | 18 +++++++++--------- tests/{cpuset => virsh-cpuset} | 0 .../{define-dev-segfault => virsh-define-dev-segfault} | 0 tests/{int-overflow => virsh-int-overflow} | 0 tests/{read-bufsiz => virsh-read-bufsiz} | 0 tests/{read-non-seekable => virsh-read-non-seekable} | 0 tests/{start => virsh-start} | 0 tests/{vcpupin => virsh-vcpupin} | 0 8 files changed, 9 insertions(+), 9 deletions(-) rename tests/{cpuset => virsh-cpuset} (100%) rename tests/{define-dev-segfault => virsh-define-dev-segfault} (100%) rename tests/{int-overflow => virsh-int-overflow} (100%) rename tests/{read-bufsiz => virsh-read-bufsiz} (100%) rename tests/{read-non-seekable => virsh-read-non-seekable} (100%) rename tests/{start => virsh-start} (100%) rename tests/{vcpupin => virsh-vcpupin} (100%) diff --git a/tests/Makefile.am b/tests/Makefile.am index b32435d..edf7b22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -368,22 +368,22 @@ test_scripts = \ secretschematest libvirtd_test_scripts = \ - test_conf.sh \ - cpuset \ - define-dev-segfault \ - int-overflow \ libvirtd-fail \ libvirtd-pool \ - read-bufsiz \ - read-non-seekable \ - start \ - virsh-uriprecedence \ - vcpupin \ + test_conf.sh \ virsh-all \ + virsh-cpuset \ + virsh-define-dev-segfault \ + virsh-int-overflow \ virsh-optparse \ + virsh-read-bufsiz \ + virsh-read-non-seekable \ virsh-schedinfo \ + virsh-start \ virsh-synopsis \ virsh-undefine \ + virsh-uriprecedence \ + virsh-vcpupin \ $(NULL) if WITH_LIBVIRTD diff --git a/tests/cpuset b/tests/virsh-cpuset similarity index 100% rename from tests/cpuset rename to tests/virsh-cpuset diff --git a/tests/define-dev-segfault b/tests/virsh-define-dev-segfault similarity index 100% rename from tests/define-dev-segfault rename to tests/virsh-define-dev-segfault diff --git a/tests/int-overflow b/tests/virsh-int-overflow similarity index 100% rename from tests/int-overflow rename to tests/virsh-int-overflow diff --git a/tests/read-bufsiz b/tests/virsh-read-bufsiz similarity index 100% rename from tests/read-bufsiz rename to tests/virsh-read-bufsiz diff --git a/tests/read-non-seekable b/tests/virsh-read-non-seekable similarity index 100% rename from tests/read-non-seekable rename to tests/virsh-read-non-seekable diff --git a/tests/start b/tests/virsh-start similarity index 100% rename from tests/start rename to tests/virsh-start diff --git a/tests/vcpupin b/tests/virsh-vcpupin similarity index 100% rename from tests/vcpupin rename to tests/virsh-vcpupin -- 2.7.3

On 04/21/2016 01:50 PM, Cole Robinson wrote:
--- tests/Makefile.am | 18 +++++++++--------- tests/{cpuset => virsh-cpuset} | 0 .../{define-dev-segfault => virsh-define-dev-segfault} | 0 tests/{int-overflow => virsh-int-overflow} | 0 tests/{read-bufsiz => virsh-read-bufsiz} | 0 tests/{read-non-seekable => virsh-read-non-seekable} | 0 tests/{start => virsh-start} | 0 tests/{vcpupin => virsh-vcpupin} | 0 8 files changed, 9 insertions(+), 9 deletions(-) rename tests/{cpuset => virsh-cpuset} (100%) rename tests/{define-dev-segfault => virsh-define-dev-segfault} (100%) rename tests/{int-overflow => virsh-int-overflow} (100%) rename tests/{read-bufsiz => virsh-read-bufsiz} (100%) rename tests/{read-non-seekable => virsh-read-non-seekable} (100%) rename tests/{start => virsh-start} (100%) rename tests/{vcpupin => virsh-vcpupin} (100%)
diff --git a/tests/Makefile.am b/tests/Makefile.am index b32435d..edf7b22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -368,22 +368,22 @@ test_scripts = \ secretschematest
libvirtd_test_scripts = \ - test_conf.sh \ - cpuset \ - define-dev-segfault \ - int-overflow \ libvirtd-fail \ libvirtd-pool \ - read-bufsiz \ - read-non-seekable \ - start \ - virsh-uriprecedence \ - vcpupin \ + test_conf.sh \ virsh-all \ + virsh-cpuset \ + virsh-define-dev-segfault \ + virsh-int-overflow \ virsh-optparse \ + virsh-read-bufsiz \ + virsh-read-non-seekable \ virsh-schedinfo \ + virsh-start \ virsh-synopsis \ virsh-undefine \ + virsh-uriprecedence \ + virsh-vcpupin \ $(NULL)
if WITH_LIBVIRTD diff --git a/tests/cpuset b/tests/virsh-cpuset similarity index 100% rename from tests/cpuset rename to tests/virsh-cpuset diff --git a/tests/define-dev-segfault b/tests/virsh-define-dev-segfault similarity index 100% rename from tests/define-dev-segfault rename to tests/virsh-define-dev-segfault diff --git a/tests/int-overflow b/tests/virsh-int-overflow similarity index 100% rename from tests/int-overflow rename to tests/virsh-int-overflow diff --git a/tests/read-bufsiz b/tests/virsh-read-bufsiz similarity index 100% rename from tests/read-bufsiz rename to tests/virsh-read-bufsiz diff --git a/tests/read-non-seekable b/tests/virsh-read-non-seekable similarity index 100% rename from tests/read-non-seekable rename to tests/virsh-read-non-seekable diff --git a/tests/start b/tests/virsh-start similarity index 100% rename from tests/start rename to tests/virsh-start diff --git a/tests/vcpupin b/tests/virsh-vcpupin similarity index 100% rename from tests/vcpupin rename to tests/virsh-vcpupin
ACK.

And confdata to virconfdata, since 'conf' can mean a few different things in libvirt --- cfg.mk | 2 +- tests/Makefile.am | 12 ++++++------ tests/{confdata => virconfdata}/fc4.conf | 0 tests/{confdata => virconfdata}/fc4.out | 0 tests/{confdata => virconfdata}/libvirtd.conf | 0 tests/{confdata => virconfdata}/libvirtd.out | 0 tests/{confdata => virconfdata}/no-newline.conf | 0 tests/{confdata => virconfdata}/no-newline.out | 0 tests/{test_conf.c => virconftest.c} | 0 tests/{test_conf.sh => virconftest.sh} | 0 10 files changed, 7 insertions(+), 7 deletions(-) rename tests/{confdata => virconfdata}/fc4.conf (100%) rename tests/{confdata => virconfdata}/fc4.out (100%) rename tests/{confdata => virconfdata}/libvirtd.conf (100%) rename tests/{confdata => virconfdata}/libvirtd.out (100%) rename tests/{confdata => virconfdata}/no-newline.conf (100%) rename tests/{confdata => virconfdata}/no-newline.out (100%) rename tests/{test_conf.c => virconftest.c} (100%) rename tests/{test_conf.sh => virconftest.sh} (100%) diff --git a/cfg.mk b/cfg.mk index 09ff9fa..cc5ea9e 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1179,7 +1179,7 @@ exclude_file_name_regexp--sc_prohibit_close = \ (\.p[yl]$$|\.spec\.in$$|^docs/|^(src/util/virfile\.c|src/libvirt-stream\.c|tests/vir.+mock\.c)$$) exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ - (^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.diff|tests/confdata/no-newline\.conf$$) + (^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.diff|tests/virconfdata/no-newline\.conf$$) _src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon) exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ diff --git a/tests/Makefile.am b/tests/Makefile.am index edf7b22..a803e84 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -81,7 +81,6 @@ EXTRA_DIST = \ capabilityschemadata \ capabilityschematest \ commanddata \ - confdata \ cputestdata \ domaincapsschemadata \ domaincapsschematest \ @@ -142,6 +141,7 @@ EXTRA_DIST = \ vboxsnapshotxmldata \ vircaps2xmldata \ vircgroupdata \ + virconfdata \ virfiledata \ virmock.h \ virnetdaemondata \ @@ -158,7 +158,7 @@ EXTRA_DIST = \ xml2sexprdata \ xml2vmxdata -test_helpers = commandhelper ssh test_conf +test_helpers = commandhelper ssh virconftest test_programs = virshtest sockettest \ nodeinfotest virbuftest \ commandtest seclabeltest \ @@ -370,7 +370,7 @@ test_scripts = \ libvirtd_test_scripts = \ libvirtd-fail \ libvirtd-pool \ - test_conf.sh \ + virconftest.sh \ virsh-all \ virsh-cpuset \ virsh-define-dev-segfault \ @@ -857,9 +857,9 @@ virshtest_SOURCES = \ testutils.c testutils.h virshtest_LDADD = $(LDADDS) -test_conf_SOURCES = \ - test_conf.c -test_conf_LDADD = $(LDADDS) +virconftest_SOURCES = \ + virconftest.c +virconftest_LDADD = $(LDADDS) nodeinfotest_SOURCES = \ nodeinfotest.c testutils.h testutils.c diff --git a/tests/confdata/fc4.conf b/tests/virconfdata/fc4.conf similarity index 100% rename from tests/confdata/fc4.conf rename to tests/virconfdata/fc4.conf diff --git a/tests/confdata/fc4.out b/tests/virconfdata/fc4.out similarity index 100% rename from tests/confdata/fc4.out rename to tests/virconfdata/fc4.out diff --git a/tests/confdata/libvirtd.conf b/tests/virconfdata/libvirtd.conf similarity index 100% rename from tests/confdata/libvirtd.conf rename to tests/virconfdata/libvirtd.conf diff --git a/tests/confdata/libvirtd.out b/tests/virconfdata/libvirtd.out similarity index 100% rename from tests/confdata/libvirtd.out rename to tests/virconfdata/libvirtd.out diff --git a/tests/confdata/no-newline.conf b/tests/virconfdata/no-newline.conf similarity index 100% rename from tests/confdata/no-newline.conf rename to tests/virconfdata/no-newline.conf diff --git a/tests/confdata/no-newline.out b/tests/virconfdata/no-newline.out similarity index 100% rename from tests/confdata/no-newline.out rename to tests/virconfdata/no-newline.out diff --git a/tests/test_conf.c b/tests/virconftest.c similarity index 100% rename from tests/test_conf.c rename to tests/virconftest.c diff --git a/tests/test_conf.sh b/tests/virconftest.sh similarity index 100% rename from tests/test_conf.sh rename to tests/virconftest.sh -- 2.7.3

This unifys the test scripts to using the similar pattern added for schematests in ace4aecd. This gives the following - Enables running all tests from outside of tests/ dir - Drops redundant abs_* definitions, which are set by test-lib.sh - Drops unnecessary srcdir variable which was only used for sourcing test-lib.sh Behavior changes: - srcdir can no longer be overwritten, but I don't know why anyone would really need to... - Script VERBOSE setting no longer prints commands executed by test-lib.sh. if anyone cares I suggest handling this in test-lib.sh which already has other verbose style handling --- tests/capabilityschematest | 3 +-- tests/domaincapsschematest | 3 +-- tests/domainschematest | 3 +-- tests/domainsnapshotschematest | 3 +-- tests/interfaceschematest | 3 +-- tests/libvirtd-fail | 6 +----- tests/libvirtd-pool | 6 +----- tests/networkschematest | 3 +-- tests/nodedevschematest | 3 +-- tests/nwfilterschematest | 3 +-- tests/secretschematest | 3 +-- tests/storagepoolschematest | 3 +-- tests/storagevolschematest | 3 +-- tests/virconftest.sh | 4 +--- tests/virsh-all | 4 +--- tests/virsh-cpuset | 6 +----- tests/virsh-define-dev-segfault | 6 +----- tests/virsh-int-overflow | 6 +----- tests/virsh-optparse | 6 +----- tests/virsh-read-bufsiz | 6 +----- tests/virsh-read-non-seekable | 6 +----- tests/virsh-schedinfo | 6 +----- tests/virsh-start | 6 +----- tests/virsh-synopsis | 6 +----- tests/virsh-undefine | 6 +----- tests/virsh-uriprecedence | 3 +-- tests/virsh-vcpupin | 6 +----- 27 files changed, 27 insertions(+), 95 deletions(-) diff --git a/tests/capabilityschematest b/tests/capabilityschematest index 78fbc8e..458212e 100755 --- a/tests/capabilityschematest +++ b/tests/capabilityschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="capabilityschemadata xencapsdata" diff --git a/tests/domaincapsschematest b/tests/domaincapsschematest index 2c19ac4..3b2021f 100755 --- a/tests/domaincapsschematest +++ b/tests/domaincapsschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="" diff --git a/tests/domainschematest b/tests/domainschematest index 3271a28..c059c98 100755 --- a/tests/domainschematest +++ b/tests/domainschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="" diff --git a/tests/domainsnapshotschematest b/tests/domainsnapshotschematest index ba28e05..33b539a 100755 --- a/tests/domainsnapshotschematest +++ b/tests/domainsnapshotschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="domainsnapshotxml2xmlin domainsnapshotxml2xmlout" diff --git a/tests/interfaceschematest b/tests/interfaceschematest index 47745ea..239b749 100755 --- a/tests/interfaceschematest +++ b/tests/interfaceschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="interfaceschemadata" diff --git a/tests/libvirtd-fail b/tests/libvirtd-fail index c6b6876..6c61b89 100755 --- a/tests/libvirtd-fail +++ b/tests/libvirtd-fail @@ -1,17 +1,13 @@ #!/bin/sh # Ensure that libvirt fails when given nonexistent --config=FILE -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/daemon/libvirtd --version fi -. "$srcdir/test-lib.sh" - fail=0 $abs_top_builddir/daemon/libvirtd --config=no-such-conf --timeout=5 2> log diff --git a/tests/libvirtd-pool b/tests/libvirtd-pool index ca1db94..4be65c6 100755 --- a/tests/libvirtd-pool +++ b/tests/libvirtd-pool @@ -1,17 +1,13 @@ #!/bin/sh # Get coverage of virsh pool-define-as XML formatting -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 pwd=$(pwd) || fail=1 diff --git a/tests/networkschematest b/tests/networkschematest index fe46893..adbc7f4 100755 --- a/tests/networkschematest +++ b/tests/networkschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="../src/network networkxml2xmlin networkxml2xmlout" diff --git a/tests/nodedevschematest b/tests/nodedevschematest index 07b1f7b..1d85371 100755 --- a/tests/nodedevschematest +++ b/tests/nodedevschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="nodedevschemadata" diff --git a/tests/nwfilterschematest b/tests/nwfilterschematest index 8703e21..408034c 100755 --- a/tests/nwfilterschematest +++ b/tests/nwfilterschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="nwfilterxml2xmlout" diff --git a/tests/secretschematest b/tests/secretschematest index 23b0e2f..9c29021 100755 --- a/tests/secretschematest +++ b/tests/secretschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="secretxml2xmlin" diff --git a/tests/storagepoolschematest b/tests/storagepoolschematest index ebea711..ebbf4d1 100755 --- a/tests/storagepoolschematest +++ b/tests/storagepoolschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="storagepoolxml2xmlin storagepoolxml2xmlout storagepoolschemadata" diff --git a/tests/storagevolschematest b/tests/storagevolschematest index 395df57..d3ba3a8 100755 --- a/tests/storagevolschematest +++ b/tests/storagevolschematest @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh DIRS="storagevolxml2xmlin storagevolxml2xmlout storagevolschemadata" diff --git a/tests/virconftest.sh b/tests/virconftest.sh index 2920e28..0fd5bbe 100755 --- a/tests/virconftest.sh +++ b/tests/virconftest.sh @@ -1,8 +1,6 @@ #!/bin/sh -test -z "$srcdir" && srcdir=$(pwd) - -. "$srcdir/test-lib.sh" +. "$(dirname $0)/test-lib.sh" test_intro $this_test diff --git a/tests/virsh-all b/tests/virsh-all index 4e456c6..4a91e4e 100755 --- a/tests/virsh-all +++ b/tests/virsh-all @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) - -. "$srcdir/test-lib.sh" +. "$(dirname $0)/test-lib.sh" test_expensive diff --git a/tests/virsh-cpuset b/tests/virsh-cpuset index 35803be..6616301 100755 --- a/tests/virsh-cpuset +++ b/tests/virsh-cpuset @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 # generate input diff --git a/tests/virsh-define-dev-segfault b/tests/virsh-define-dev-segfault index 81a8773..44fc6dc 100755 --- a/tests/virsh-define-dev-segfault +++ b/tests/virsh-define-dev-segfault @@ -2,17 +2,13 @@ # Exercise a bug whereby defining a valid domain could kill libvirtd. # The bug can also be exercised with a simple define/dumpxml pair to virsh. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 # Domain definition from Cole Robinson. diff --git a/tests/virsh-int-overflow b/tests/virsh-int-overflow index 36e5536..e9eb03b 100755 --- a/tests/virsh-int-overflow +++ b/tests/virsh-int-overflow @@ -2,17 +2,13 @@ # Ensure that an invalid domain ID isn't interpreted as a valid one. # Before, an ID of 2^32+2 would be treated just like an ID of 2. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - echo "error: failed to get domain '4294967298'" > exp || fail=1 $abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ diff --git a/tests/virsh-optparse b/tests/virsh-optparse index 0fc261d..cbd6c30 100755 --- a/tests/virsh-optparse +++ b/tests/virsh-optparse @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -: ${srcdir=$(pwd)} -: ${abs_top_srcdir=$(pwd)/..} -: ${abs_top_builddir=$(pwd)/..} +. "$(dirname $0)/test-lib.sh" # If $abs_top_builddir/tools is not early in $PATH, put it there, # so that we can safely invoke "virsh" simply with its name. @@ -34,8 +32,6 @@ if test "$VERBOSE" = yes; then virsh --version fi -. "$srcdir/test-lib.sh" - cat <<\EOF > exp-out || framework_failure setvcpus: <domain> trying as domain NAME diff --git a/tests/virsh-read-bufsiz b/tests/virsh-read-bufsiz index 23c3b53..116eff1 100755 --- a/tests/virsh-read-bufsiz +++ b/tests/virsh-read-bufsiz @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=`pwd` -test -z "$abs_top_srcdir" && abs_top_srcdir=`pwd`/.. -test -z "$abs_top_builddir" && abs_top_builddir=`pwd`/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 # Output a valid definition, to be used as input. diff --git a/tests/virsh-read-non-seekable b/tests/virsh-read-non-seekable index 46e2831..0f7504c 100755 --- a/tests/virsh-read-non-seekable +++ b/tests/virsh-read-non-seekable @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=`pwd` -test -z "$abs_top_srcdir" && abs_top_srcdir=`pwd`/.. -test -z "$abs_top_builddir" && abs_top_builddir=`pwd`/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 cat <<\EOF > dom diff --git a/tests/virsh-schedinfo b/tests/virsh-schedinfo index 37f7bd3..d6d9ac2 100755 --- a/tests/virsh-schedinfo +++ b/tests/virsh-schedinfo @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -: ${srcdir=$(pwd)} -: ${abs_top_srcdir=$(pwd)/..} -: ${abs_top_builddir=$(pwd)/..} +. "$(dirname $0)/test-lib.sh" # If $abs_top_builddir/tools is not early in $PATH, put it there, # so that we can safely invoke "virsh" simply with its name. @@ -34,8 +32,6 @@ if test "$VERBOSE" = yes; then virsh --version fi -. "$srcdir/test-lib.sh" - printf 'Scheduler : fair\n\n' > exp-out || framework_failure printf 'error: invalid scheduler option: j\n' > exp-err || framework_failure diff --git a/tests/virsh-start b/tests/virsh-start index 5d4c0a7..cb58c3b 100755 --- a/tests/virsh-start +++ b/tests/virsh-start @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 test_url=test:///default diff --git a/tests/virsh-synopsis b/tests/virsh-synopsis index cacdee4..d0d1197 100755 --- a/tests/virsh-synopsis +++ b/tests/virsh-synopsis @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 test_url=test:///default diff --git a/tests/virsh-undefine b/tests/virsh-undefine index f7ba495..6494b4a 100755 --- a/tests/virsh-undefine +++ b/tests/virsh-undefine @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 # Attempt to undefine a running domain, by domain name. Every time a new diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence index f9e3256..1cf3d22 100755 --- a/tests/virsh-uriprecedence +++ b/tests/virsh-uriprecedence @@ -1,7 +1,6 @@ #!/bin/sh -: ${srcdir=.} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" # This test checks if virsh obeys the proper precedence of different # URI settings diff --git a/tests/virsh-vcpupin b/tests/virsh-vcpupin index 9e656c0..306552a 100755 --- a/tests/virsh-vcpupin +++ b/tests/virsh-vcpupin @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh" if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi -. "$srcdir/test-lib.sh" - fail=0 # Invalid syntax. -- 2.7.3

On 04/21/2016 01:50 PM, Cole Robinson wrote:
This unifys the test scripts to using the similar pattern added for
"unifies the test scripts to all use ..." otherwise looks okay. I tried make distcheck and it passes, so ACK.
schematests in ace4aecd. This gives the following
- Enables running all tests from outside of tests/ dir - Drops redundant abs_* definitions, which are set by test-lib.sh - Drops unnecessary srcdir variable which was only used for sourcing test-lib.sh
Behavior changes:
- srcdir can no longer be overwritten, but I don't know why anyone would really need to... - Script VERBOSE setting no longer prints commands executed by test-lib.sh. if anyone cares I suggest handling this in test-lib.sh which already has other verbose style handling --- tests/capabilityschematest | 3 +-- tests/domaincapsschematest | 3 +-- tests/domainschematest | 3 +-- tests/domainsnapshotschematest | 3 +-- tests/interfaceschematest | 3 +-- tests/libvirtd-fail | 6 +----- tests/libvirtd-pool | 6 +----- tests/networkschematest | 3 +-- tests/nodedevschematest | 3 +-- tests/nwfilterschematest | 3 +-- tests/secretschematest | 3 +-- tests/storagepoolschematest | 3 +-- tests/storagevolschematest | 3 +-- tests/virconftest.sh | 4 +--- tests/virsh-all | 4 +--- tests/virsh-cpuset | 6 +----- tests/virsh-define-dev-segfault | 6 +----- tests/virsh-int-overflow | 6 +----- tests/virsh-optparse | 6 +----- tests/virsh-read-bufsiz | 6 +----- tests/virsh-read-non-seekable | 6 +----- tests/virsh-schedinfo | 6 +----- tests/virsh-start | 6 +----- tests/virsh-synopsis | 6 +----- tests/virsh-undefine | 6 +----- tests/virsh-uriprecedence | 3 +-- tests/virsh-vcpupin | 6 +----- 27 files changed, 27 insertions(+), 95 deletions(-)
diff --git a/tests/capabilityschematest b/tests/capabilityschematest index 78fbc8e..458212e 100755 --- a/tests/capabilityschematest +++ b/tests/capabilityschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="capabilityschemadata xencapsdata" diff --git a/tests/domaincapsschematest b/tests/domaincapsschematest index 2c19ac4..3b2021f 100755 --- a/tests/domaincapsschematest +++ b/tests/domaincapsschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="" diff --git a/tests/domainschematest b/tests/domainschematest index 3271a28..c059c98 100755 --- a/tests/domainschematest +++ b/tests/domainschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="" diff --git a/tests/domainsnapshotschematest b/tests/domainsnapshotschematest index ba28e05..33b539a 100755 --- a/tests/domainsnapshotschematest +++ b/tests/domainsnapshotschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="domainsnapshotxml2xmlin domainsnapshotxml2xmlout" diff --git a/tests/interfaceschematest b/tests/interfaceschematest index 47745ea..239b749 100755 --- a/tests/interfaceschematest +++ b/tests/interfaceschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="interfaceschemadata" diff --git a/tests/libvirtd-fail b/tests/libvirtd-fail index c6b6876..6c61b89 100755 --- a/tests/libvirtd-fail +++ b/tests/libvirtd-fail @@ -1,17 +1,13 @@ #!/bin/sh # Ensure that libvirt fails when given nonexistent --config=FILE
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/daemon/libvirtd --version fi
-. "$srcdir/test-lib.sh" - fail=0
$abs_top_builddir/daemon/libvirtd --config=no-such-conf --timeout=5 2> log diff --git a/tests/libvirtd-pool b/tests/libvirtd-pool index ca1db94..4be65c6 100755 --- a/tests/libvirtd-pool +++ b/tests/libvirtd-pool @@ -1,17 +1,13 @@ #!/bin/sh # Get coverage of virsh pool-define-as XML formatting
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
pwd=$(pwd) || fail=1 diff --git a/tests/networkschematest b/tests/networkschematest index fe46893..adbc7f4 100755 --- a/tests/networkschematest +++ b/tests/networkschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="../src/network networkxml2xmlin networkxml2xmlout" diff --git a/tests/nodedevschematest b/tests/nodedevschematest index 07b1f7b..1d85371 100755 --- a/tests/nodedevschematest +++ b/tests/nodedevschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="nodedevschemadata" diff --git a/tests/nwfilterschematest b/tests/nwfilterschematest index 8703e21..408034c 100755 --- a/tests/nwfilterschematest +++ b/tests/nwfilterschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="nwfilterxml2xmlout" diff --git a/tests/secretschematest b/tests/secretschematest index 23b0e2f..9c29021 100755 --- a/tests/secretschematest +++ b/tests/secretschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="secretxml2xmlin" diff --git a/tests/storagepoolschematest b/tests/storagepoolschematest index ebea711..ebbf4d1 100755 --- a/tests/storagepoolschematest +++ b/tests/storagepoolschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="storagepoolxml2xmlin storagepoolxml2xmlout storagepoolschemadata" diff --git a/tests/storagevolschematest b/tests/storagevolschematest index 395df57..d3ba3a8 100755 --- a/tests/storagevolschematest +++ b/tests/storagevolschematest @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=$(dirname $0)} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh" . $abs_srcdir/schematestutils.sh
DIRS="storagevolxml2xmlin storagevolxml2xmlout storagevolschemadata" diff --git a/tests/virconftest.sh b/tests/virconftest.sh index 2920e28..0fd5bbe 100755 --- a/tests/virconftest.sh +++ b/tests/virconftest.sh @@ -1,8 +1,6 @@ #!/bin/sh
-test -z "$srcdir" && srcdir=$(pwd) - -. "$srcdir/test-lib.sh" +. "$(dirname $0)/test-lib.sh"
test_intro $this_test
diff --git a/tests/virsh-all b/tests/virsh-all index 4e456c6..4a91e4e 100755 --- a/tests/virsh-all +++ b/tests/virsh-all @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) - -. "$srcdir/test-lib.sh" +. "$(dirname $0)/test-lib.sh"
test_expensive
diff --git a/tests/virsh-cpuset b/tests/virsh-cpuset index 35803be..6616301 100755 --- a/tests/virsh-cpuset +++ b/tests/virsh-cpuset @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
# generate input diff --git a/tests/virsh-define-dev-segfault b/tests/virsh-define-dev-segfault index 81a8773..44fc6dc 100755 --- a/tests/virsh-define-dev-segfault +++ b/tests/virsh-define-dev-segfault @@ -2,17 +2,13 @@ # Exercise a bug whereby defining a valid domain could kill libvirtd. # The bug can also be exercised with a simple define/dumpxml pair to virsh.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
# Domain definition from Cole Robinson. diff --git a/tests/virsh-int-overflow b/tests/virsh-int-overflow index 36e5536..e9eb03b 100755 --- a/tests/virsh-int-overflow +++ b/tests/virsh-int-overflow @@ -2,17 +2,13 @@ # Ensure that an invalid domain ID isn't interpreted as a valid one. # Before, an ID of 2^32+2 would be treated just like an ID of 2.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - echo "error: failed to get domain '4294967298'" > exp || fail=1 $abs_top_builddir/tools/virsh --quiet \ --connect test://$abs_top_srcdir/examples/xml/test/testnode.xml \ diff --git a/tests/virsh-optparse b/tests/virsh-optparse index 0fc261d..cbd6c30 100755 --- a/tests/virsh-optparse +++ b/tests/virsh-optparse @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-: ${srcdir=$(pwd)} -: ${abs_top_srcdir=$(pwd)/..} -: ${abs_top_builddir=$(pwd)/..} +. "$(dirname $0)/test-lib.sh"
# If $abs_top_builddir/tools is not early in $PATH, put it there, # so that we can safely invoke "virsh" simply with its name. @@ -34,8 +32,6 @@ if test "$VERBOSE" = yes; then virsh --version fi
-. "$srcdir/test-lib.sh" - cat <<\EOF > exp-out || framework_failure
setvcpus: <domain> trying as domain NAME diff --git a/tests/virsh-read-bufsiz b/tests/virsh-read-bufsiz index 23c3b53..116eff1 100755 --- a/tests/virsh-read-bufsiz +++ b/tests/virsh-read-bufsiz @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=`pwd` -test -z "$abs_top_srcdir" && abs_top_srcdir=`pwd`/.. -test -z "$abs_top_builddir" && abs_top_builddir=`pwd`/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
# Output a valid definition, to be used as input. diff --git a/tests/virsh-read-non-seekable b/tests/virsh-read-non-seekable index 46e2831..0f7504c 100755 --- a/tests/virsh-read-non-seekable +++ b/tests/virsh-read-non-seekable @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=`pwd` -test -z "$abs_top_srcdir" && abs_top_srcdir=`pwd`/.. -test -z "$abs_top_builddir" && abs_top_builddir=`pwd`/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
cat <<\EOF > dom diff --git a/tests/virsh-schedinfo b/tests/virsh-schedinfo index 37f7bd3..d6d9ac2 100755 --- a/tests/virsh-schedinfo +++ b/tests/virsh-schedinfo @@ -17,9 +17,7 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-: ${srcdir=$(pwd)} -: ${abs_top_srcdir=$(pwd)/..} -: ${abs_top_builddir=$(pwd)/..} +. "$(dirname $0)/test-lib.sh"
# If $abs_top_builddir/tools is not early in $PATH, put it there, # so that we can safely invoke "virsh" simply with its name. @@ -34,8 +32,6 @@ if test "$VERBOSE" = yes; then virsh --version fi
-. "$srcdir/test-lib.sh" - printf 'Scheduler : fair\n\n' > exp-out || framework_failure printf 'error: invalid scheduler option: j\n' > exp-err || framework_failure
diff --git a/tests/virsh-start b/tests/virsh-start index 5d4c0a7..cb58c3b 100755 --- a/tests/virsh-start +++ b/tests/virsh-start @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
test_url=test:///default diff --git a/tests/virsh-synopsis b/tests/virsh-synopsis index cacdee4..d0d1197 100755 --- a/tests/virsh-synopsis +++ b/tests/virsh-synopsis @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
test_url=test:///default diff --git a/tests/virsh-undefine b/tests/virsh-undefine index f7ba495..6494b4a 100755 --- a/tests/virsh-undefine +++ b/tests/virsh-undefine @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
# Attempt to undefine a running domain, by domain name. Every time a new diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence index f9e3256..1cf3d22 100755 --- a/tests/virsh-uriprecedence +++ b/tests/virsh-uriprecedence @@ -1,7 +1,6 @@ #!/bin/sh
-: ${srcdir=.} -. $srcdir/test-lib.sh +. "$(dirname $0)/test-lib.sh"
# This test checks if virsh obeys the proper precedence of different # URI settings diff --git a/tests/virsh-vcpupin b/tests/virsh-vcpupin index 9e656c0..306552a 100755 --- a/tests/virsh-vcpupin +++ b/tests/virsh-vcpupin @@ -17,17 +17,13 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>.
-test -z "$srcdir" && srcdir=$(pwd) -test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. -test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/.. +. "$(dirname $0)/test-lib.sh"
if test "$VERBOSE" = yes; then set -x $abs_top_builddir/tools/virsh --version fi
-. "$srcdir/test-lib.sh" - fail=0
# Invalid syntax.

On 04/23/2016 03:26 PM, Laine Stump wrote:
On 04/21/2016 01:50 PM, Cole Robinson wrote:
This unifys the test scripts to using the similar pattern added for
"unifies the test scripts to all use ..."
otherwise looks okay. I tried make distcheck and it passes, so ACK.
Thanks, fixed and pushed - Cole

These old tests expect to run against a real xen connection via xend running on the host. Our intentions for the test suite are that it doesn't require interacting with any specific host resources, so these don't really belong here. --- tests/Makefile.am | 12 +--- tests/reconnect.c | 71 ------------------ tests/statstest.c | 210 ------------------------------------------------------ 3 files changed, 2 insertions(+), 291 deletions(-) delete mode 100644 tests/reconnect.c delete mode 100644 tests/statstest.c diff --git a/tests/Makefile.am b/tests/Makefile.am index a803e84..8cf53bf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -243,7 +243,7 @@ ssh_LDADD = $(COVERAGE_LDFLAGS) if WITH_XEN test_programs += xml2sexprtest sexpr2xmltest \ - xmconfigtest xencapstest statstest reconnect + xmconfigtest xencapstest endif WITH_XEN if WITH_LIBXL @@ -504,17 +504,9 @@ xencapstest_SOURCES = \ xencapstest.c testutils.h testutils.c xencapstest_LDADD = $(xen_LDADDS) -reconnect_SOURCES = \ - reconnect.c testutils.h testutils.c -reconnect_LDADD = $(LDADDS) - -statstest_SOURCES = \ - statstest.c testutils.h testutils.c -statstest_LDADD = $(xen_LDADDS) - else ! WITH_XEN EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \ - xencapstest.c reconnect.c \ + xencapstest.c \ testutilsxen.c testutilsxen.h endif ! WITH_XEN diff --git a/tests/reconnect.c b/tests/reconnect.c deleted file mode 100644 index f0779ad..0000000 --- a/tests/reconnect.c +++ /dev/null @@ -1,71 +0,0 @@ -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <sys/utsname.h> - -#include "internal.h" -#include "testutils.h" -#include "vircommand.h" - -static int -mymain(void) -{ - int id = 0; - bool ro = false; - virConnectPtr conn; - virDomainPtr dom; - virCommandPtr cmd; - struct utsname ut; - - /* Skip test if xend is not running. Calling xend on a non-xen - kernel causes some versions of xend to issue a crash report, so - we first probe uname results. */ - uname(&ut); - if (strstr(ut.release, "xen") == NULL) - return EXIT_AM_SKIP; - cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); - if (virCommandRun(cmd, NULL) < 0) { - virCommandFree(cmd); - return EXIT_AM_SKIP; - } - virCommandFree(cmd); - - virtTestQuiesceLibvirtErrors(true); - - conn = virConnectOpen(NULL); - if (conn == NULL) { - ro = true; - conn = virConnectOpenReadOnly(NULL); - } - if (conn == NULL) { - fprintf(stderr, "First virConnectOpen() failed\n"); - return EXIT_FAILURE; - } - dom = virDomainLookupByID(conn, id); - if (dom == NULL) { - fprintf(stderr, "First lookup for domain %d failed\n", id); - return EXIT_FAILURE; - } - virDomainFree(dom); - virConnectClose(conn); - if (ro) - conn = virConnectOpenReadOnly(NULL); - else - conn = virConnectOpen(NULL); - if (conn == NULL) { - fprintf(stderr, "Second virConnectOpen() failed\n"); - return EXIT_FAILURE; - } - dom = virDomainLookupByID(conn, id); - if (dom == NULL) { - fprintf(stderr, "Second lookup for domain %d failed\n", id); - return EXIT_FAILURE; - } - virDomainFree(dom); - virConnectClose(conn); - - return EXIT_SUCCESS; -} - -VIRT_TEST_MAIN(mymain) diff --git a/tests/statstest.c b/tests/statstest.c deleted file mode 100644 index 46e5560..0000000 --- a/tests/statstest.c +++ /dev/null @@ -1,210 +0,0 @@ -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/utsname.h> - -#include "virstats.h" -#include "internal.h" -#include "xen/block_stats.h" -#include "testutils.h" -#include "vircommand.h" - -static int testDevice(const char *path, int expect) -{ - int actual = xenLinuxDomainDeviceID(1, path); - - if (actual == expect) { - return 0; - } else { - VIR_TEST_DEBUG("Expect %-6d Actual %-6d\n", expect, actual); - return -1; - } -} - -struct testInfo -{ - const char *dev; - int num; -}; - -static int testDeviceHelper(const void *data) -{ - const struct testInfo *info = data; - return testDevice(info->dev, info->num); -} - -static int -mymain(void) -{ - int ret = 0; - virCommandPtr cmd; - struct utsname ut; - - /* Skip test if xend is not running. Calling xend on a non-xen - kernel causes some versions of xend to issue a crash report, so - we first probe uname results. */ - uname(&ut); - if (strstr(ut.release, "xen") == NULL) - return EXIT_AM_SKIP; - cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); - if (virCommandRun(cmd, NULL) < 0) { - virCommandFree(cmd); - return EXIT_AM_SKIP; - } - virCommandFree(cmd); - - /* Some of our tests deliberately test failure cases, so - * register a handler to stop error messages cluttering - * up display - */ - virtTestQuiesceLibvirtErrors(false); - -#define DO_TEST(dev, num) \ - do { \ - struct testInfo info = { dev, num }; \ - if (virtTestRun("Device " dev " -> " # num, \ - testDeviceHelper, &info) < 0) \ - ret = -1; \ - } while (0) - - /******************************** - * Xen paravirt disks - ********************************/ - - DO_TEST("xvd", -1); - - /* first valid disk */ - DO_TEST("xvda", 51712); - DO_TEST("xvda1", 51713); - DO_TEST("xvda15", 51727); - /* Last non-extended disk */ - DO_TEST("xvdp", 51952); - DO_TEST("xvdp1", 51953); - DO_TEST("xvdp15", 51967); - - /* First extended disk */ - DO_TEST("xvdq", 268439552); - DO_TEST("xvdq1", 268439553); - DO_TEST("xvdq15", 268439567); - /* Last extended disk */ - DO_TEST("xvdiz", 268501760); - DO_TEST("xvdiz1", 268501761); - DO_TEST("xvdiz15", 268501775); - - /* Disk letter too large */ - DO_TEST("xvdja", -1); - - /* missing disk letter */ - DO_TEST("xvd1", -1); - /* partition too large */ - DO_TEST("xvda16", -1); - /* partition too small */ - DO_TEST("xvda0", -1); - /* leading zeros */ - DO_TEST("xvda01", -1); - /* leading + */ - DO_TEST("xvda+1", -1); - /* leading - */ - DO_TEST("xvda-1", -1); - - /******************************** - * IDE disks - ********************************/ - - DO_TEST("hd", -1); - - /* first numbered disk */ - DO_TEST("hda", 768); - DO_TEST("hda1", 769); - DO_TEST("hda63", 831); - /* second numbered disk */ - DO_TEST("hdb", 832); - DO_TEST("hdb1", 833); - DO_TEST("hdb63", 895); - /* third numbered disk */ - DO_TEST("hdc", 5632); - DO_TEST("hdc1", 5633); - DO_TEST("hdc63", 5695); - /* fourth numbered disk */ - DO_TEST("hdd", 5696); - DO_TEST("hdd1", 5697); - DO_TEST("hdd63", 5759); - /* last valid disk */ - DO_TEST("hdt", 23360); - DO_TEST("hdt1", 23361); - DO_TEST("hdt63", 23423); - - /* Disk letter to large */ - DO_TEST("hdu", -1); - /* missing disk letter */ - DO_TEST("hd1", -1); - /* partition too large */ - DO_TEST("hda64", -1); - /* partition too small */ - DO_TEST("hda0", -1); - - - - /******************************** - * SCSI disks - ********************************/ - - DO_TEST("sd", -1); - - /* first valid disk */ - DO_TEST("sda", 2048); - DO_TEST("sda1", 2049); - DO_TEST("sda15", 2063); - /* last valid disk of first SCSI major number */ - DO_TEST("sdp", 2288); - DO_TEST("sdp1", 2289); - DO_TEST("sdp15", 2303); - /* first valid disk of second SCSI major number */ - DO_TEST("sdq", 16640); - DO_TEST("sdq1", 16641); - DO_TEST("sdq15", 16655); - /* last valid single letter disk */ - DO_TEST("sdz", 16784); - DO_TEST("sdz1", 16785); - DO_TEST("sdz15", 16799); - /* first valid dual letter disk */ - DO_TEST("sdaa", 16800); - DO_TEST("sdaa1", 16801); - DO_TEST("sdaa15", 16815); - /* second valid dual letter disk */ - DO_TEST("sdab", 16816); - DO_TEST("sdab1", 16817); - DO_TEST("sdab15", 16831); - /* first letter of second sequence of dual letter disk */ - DO_TEST("sdba", 17216); - DO_TEST("sdba1", 17217); - DO_TEST("sdba15", 17231); - /* last valid dual letter disk */ - DO_TEST("sdiv", 34800); - DO_TEST("sdiv1", 34801); - DO_TEST("sdiv15", 34815); - - /* Disk letter too large */ - DO_TEST("sdix", -1); - /* missing disk letter */ - DO_TEST("sd1", -1); - /* partition too large */ - DO_TEST("sda16", -1); - /* partition too small */ - DO_TEST("sda0", -1); - - - /* Path stripping */ - DO_TEST("/dev", -1); - DO_TEST("/dev/", -1); - DO_TEST("/dev/xvd", -1); - DO_TEST("/dev/xvda", 51712); - DO_TEST("/dev/xvda1", 51713); - DO_TEST("/dev/xvda15", 51727); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIRT_TEST_MAIN(mymain) -- 2.7.3

On 04/21/2016 01:50 PM, Cole Robinson wrote:
These old tests expect to run against a real xen connection via xend running on the host. Our intentions for the test suite are that it doesn't require interacting with any specific host resources, so these don't really belong here. ---
I agree with your reasoning, but don't use xen, so the most I can give is a "soft ACK", since someone actually using it might disagree.
tests/Makefile.am | 12 +--- tests/reconnect.c | 71 ------------------ tests/statstest.c | 210 ------------------------------------------------------ 3 files changed, 2 insertions(+), 291 deletions(-) delete mode 100644 tests/reconnect.c delete mode 100644 tests/statstest.c
diff --git a/tests/Makefile.am b/tests/Makefile.am index a803e84..8cf53bf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -243,7 +243,7 @@ ssh_LDADD = $(COVERAGE_LDFLAGS)
if WITH_XEN test_programs += xml2sexprtest sexpr2xmltest \ - xmconfigtest xencapstest statstest reconnect + xmconfigtest xencapstest endif WITH_XEN
if WITH_LIBXL @@ -504,17 +504,9 @@ xencapstest_SOURCES = \ xencapstest.c testutils.h testutils.c xencapstest_LDADD = $(xen_LDADDS)
-reconnect_SOURCES = \ - reconnect.c testutils.h testutils.c -reconnect_LDADD = $(LDADDS) - -statstest_SOURCES = \ - statstest.c testutils.h testutils.c -statstest_LDADD = $(xen_LDADDS) - else ! WITH_XEN EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \ - xencapstest.c reconnect.c \ + xencapstest.c \ testutilsxen.c testutilsxen.h endif ! WITH_XEN
diff --git a/tests/reconnect.c b/tests/reconnect.c deleted file mode 100644 index f0779ad..0000000 --- a/tests/reconnect.c +++ /dev/null @@ -1,71 +0,0 @@ -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <sys/utsname.h> - -#include "internal.h" -#include "testutils.h" -#include "vircommand.h" - -static int -mymain(void) -{ - int id = 0; - bool ro = false; - virConnectPtr conn; - virDomainPtr dom; - virCommandPtr cmd; - struct utsname ut; - - /* Skip test if xend is not running. Calling xend on a non-xen - kernel causes some versions of xend to issue a crash report, so - we first probe uname results. */ - uname(&ut); - if (strstr(ut.release, "xen") == NULL) - return EXIT_AM_SKIP; - cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); - if (virCommandRun(cmd, NULL) < 0) { - virCommandFree(cmd); - return EXIT_AM_SKIP; - } - virCommandFree(cmd); - - virtTestQuiesceLibvirtErrors(true); - - conn = virConnectOpen(NULL); - if (conn == NULL) { - ro = true; - conn = virConnectOpenReadOnly(NULL); - } - if (conn == NULL) { - fprintf(stderr, "First virConnectOpen() failed\n"); - return EXIT_FAILURE; - } - dom = virDomainLookupByID(conn, id); - if (dom == NULL) { - fprintf(stderr, "First lookup for domain %d failed\n", id); - return EXIT_FAILURE; - } - virDomainFree(dom); - virConnectClose(conn); - if (ro) - conn = virConnectOpenReadOnly(NULL); - else - conn = virConnectOpen(NULL); - if (conn == NULL) { - fprintf(stderr, "Second virConnectOpen() failed\n"); - return EXIT_FAILURE; - } - dom = virDomainLookupByID(conn, id); - if (dom == NULL) { - fprintf(stderr, "Second lookup for domain %d failed\n", id); - return EXIT_FAILURE; - } - virDomainFree(dom); - virConnectClose(conn); - - return EXIT_SUCCESS; -} - -VIRT_TEST_MAIN(mymain) diff --git a/tests/statstest.c b/tests/statstest.c deleted file mode 100644 index 46e5560..0000000 --- a/tests/statstest.c +++ /dev/null @@ -1,210 +0,0 @@ -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/utsname.h> - -#include "virstats.h" -#include "internal.h" -#include "xen/block_stats.h" -#include "testutils.h" -#include "vircommand.h" - -static int testDevice(const char *path, int expect) -{ - int actual = xenLinuxDomainDeviceID(1, path); - - if (actual == expect) { - return 0; - } else { - VIR_TEST_DEBUG("Expect %-6d Actual %-6d\n", expect, actual); - return -1; - } -} - -struct testInfo -{ - const char *dev; - int num; -}; - -static int testDeviceHelper(const void *data) -{ - const struct testInfo *info = data; - return testDevice(info->dev, info->num); -} - -static int -mymain(void) -{ - int ret = 0; - virCommandPtr cmd; - struct utsname ut; - - /* Skip test if xend is not running. Calling xend on a non-xen - kernel causes some versions of xend to issue a crash report, so - we first probe uname results. */ - uname(&ut); - if (strstr(ut.release, "xen") == NULL) - return EXIT_AM_SKIP; - cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); - if (virCommandRun(cmd, NULL) < 0) { - virCommandFree(cmd); - return EXIT_AM_SKIP; - } - virCommandFree(cmd); - - /* Some of our tests deliberately test failure cases, so - * register a handler to stop error messages cluttering - * up display - */ - virtTestQuiesceLibvirtErrors(false); - -#define DO_TEST(dev, num) \ - do { \ - struct testInfo info = { dev, num }; \ - if (virtTestRun("Device " dev " -> " # num, \ - testDeviceHelper, &info) < 0) \ - ret = -1; \ - } while (0) - - /******************************** - * Xen paravirt disks - ********************************/ - - DO_TEST("xvd", -1); - - /* first valid disk */ - DO_TEST("xvda", 51712); - DO_TEST("xvda1", 51713); - DO_TEST("xvda15", 51727); - /* Last non-extended disk */ - DO_TEST("xvdp", 51952); - DO_TEST("xvdp1", 51953); - DO_TEST("xvdp15", 51967); - - /* First extended disk */ - DO_TEST("xvdq", 268439552); - DO_TEST("xvdq1", 268439553); - DO_TEST("xvdq15", 268439567); - /* Last extended disk */ - DO_TEST("xvdiz", 268501760); - DO_TEST("xvdiz1", 268501761); - DO_TEST("xvdiz15", 268501775); - - /* Disk letter too large */ - DO_TEST("xvdja", -1); - - /* missing disk letter */ - DO_TEST("xvd1", -1); - /* partition too large */ - DO_TEST("xvda16", -1); - /* partition too small */ - DO_TEST("xvda0", -1); - /* leading zeros */ - DO_TEST("xvda01", -1); - /* leading + */ - DO_TEST("xvda+1", -1); - /* leading - */ - DO_TEST("xvda-1", -1); - - /******************************** - * IDE disks - ********************************/ - - DO_TEST("hd", -1); - - /* first numbered disk */ - DO_TEST("hda", 768); - DO_TEST("hda1", 769); - DO_TEST("hda63", 831); - /* second numbered disk */ - DO_TEST("hdb", 832); - DO_TEST("hdb1", 833); - DO_TEST("hdb63", 895); - /* third numbered disk */ - DO_TEST("hdc", 5632); - DO_TEST("hdc1", 5633); - DO_TEST("hdc63", 5695); - /* fourth numbered disk */ - DO_TEST("hdd", 5696); - DO_TEST("hdd1", 5697); - DO_TEST("hdd63", 5759); - /* last valid disk */ - DO_TEST("hdt", 23360); - DO_TEST("hdt1", 23361); - DO_TEST("hdt63", 23423); - - /* Disk letter to large */ - DO_TEST("hdu", -1); - /* missing disk letter */ - DO_TEST("hd1", -1); - /* partition too large */ - DO_TEST("hda64", -1); - /* partition too small */ - DO_TEST("hda0", -1); - - - - /******************************** - * SCSI disks - ********************************/ - - DO_TEST("sd", -1); - - /* first valid disk */ - DO_TEST("sda", 2048); - DO_TEST("sda1", 2049); - DO_TEST("sda15", 2063); - /* last valid disk of first SCSI major number */ - DO_TEST("sdp", 2288); - DO_TEST("sdp1", 2289); - DO_TEST("sdp15", 2303); - /* first valid disk of second SCSI major number */ - DO_TEST("sdq", 16640); - DO_TEST("sdq1", 16641); - DO_TEST("sdq15", 16655); - /* last valid single letter disk */ - DO_TEST("sdz", 16784); - DO_TEST("sdz1", 16785); - DO_TEST("sdz15", 16799); - /* first valid dual letter disk */ - DO_TEST("sdaa", 16800); - DO_TEST("sdaa1", 16801); - DO_TEST("sdaa15", 16815); - /* second valid dual letter disk */ - DO_TEST("sdab", 16816); - DO_TEST("sdab1", 16817); - DO_TEST("sdab15", 16831); - /* first letter of second sequence of dual letter disk */ - DO_TEST("sdba", 17216); - DO_TEST("sdba1", 17217); - DO_TEST("sdba15", 17231); - /* last valid dual letter disk */ - DO_TEST("sdiv", 34800); - DO_TEST("sdiv1", 34801); - DO_TEST("sdiv15", 34815); - - /* Disk letter too large */ - DO_TEST("sdix", -1); - /* missing disk letter */ - DO_TEST("sd1", -1); - /* partition too large */ - DO_TEST("sda16", -1); - /* partition too small */ - DO_TEST("sda0", -1); - - - /* Path stripping */ - DO_TEST("/dev", -1); - DO_TEST("/dev/", -1); - DO_TEST("/dev/xvd", -1); - DO_TEST("/dev/xvda", 51712); - DO_TEST("/dev/xvda1", 51713); - DO_TEST("/dev/xvda15", 51727); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIRT_TEST_MAIN(mymain)

On 04/22/2016 09:59 PM, Laine Stump wrote:
On 04/21/2016 01:50 PM, Cole Robinson wrote:
These old tests expect to run against a real xen connection via xend running on the host. Our intentions for the test suite are that it doesn't require interacting with any specific host resources, so these don't really belong here. ---
I agree with your reasoning, but don't use xen, so the most I can give is a "soft ACK", since someone actually using it might disagree.
I've pushed it, I'm pretty confident nobody is depending on these tests... - Cole
participants (2)
-
Cole Robinson
-
Laine Stump