1. 07 10月, 2019 1 次提交
  2. 04 4月, 2019 1 次提交
    • E
      tests: Avoid writing into $HOME during virsh-snapshot · b1886608
      Eric Blake 提交于
      In a constrained CI environment, where it is intentional that attempts
      to write outside the current directory will fail, virsh-snapshot was
      failing:
      
      @@ -1,2 +1,3 @@
       error: invalid argument: parent s3 for snapshot s2 not found
       error: marker
      +error: Failed to create '/home/travis/.cache/libvirt/virsh': Permission denied
      FAIL virsh-snapshot (exit status: 1)
      
      But we've already solved the problem in virsh-uriprecedence: tell
      virsh to use XDG locations pointing to somewhere we can write rather
      than its default of falling back to $HOME with the test being at risk
      of breaking due to the user's environment and/or unacceptably altering
      the user's normal cache.  Hoist that solution into test-lib.sh, so
      that all scripts can use it as needed. While at it, fix a latent typo
      where XDG_RUNTIME_HOME was set to a literal relative directory name
      "XDG_CACHE_HOME" (the typo did not affect virsh-uriprecedence, but
      could matter to other clients).
      
      Fixes: 280a2b41
      Fixes: 398de147Reported-by: NDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b1886608
  3. 02 5月, 2016 1 次提交
    • M
      tools: Fix connect command · 0c56d943
      Martin Kletzander 提交于
      The man page says: "(Re)-Connect to the hypervisor. When the shell is
      first started, this is automatically run with the URI parameter
      requested by the "-c" option on the command line."  However, if you run:
      
        virsh -c 'test://default' 'connect; uri'
      
      the output will not be 'test://default'.  That's because the 'connect'
      command does not care about any virsh-only related settings and if it is
      run without parameters, it connects with @uri == NULL.  Not only that
      doesn't comply to what the man page describes, but it also doesn't make
      sense.  It also means you aren't able to reconnect to whatever you are
      connected currently.
      
      So let's fix that in both virsh and virt-admin add a test case for it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      0c56d943
  4. 02 2月, 2016 1 次提交
    • E
      tests: avoid realpath in test-lib.sh · 041f7c93
      Eric Blake 提交于
      Ever since commit ace4aecd, running 'make check' on RHEL 6 produces:
      
      ./test-lib.sh: line 21: realpath: command not found
      
      for every shell script test, because 'realpath' was not part of
      coreutils back then.
      
      * tests/test-lib.sh (_scriptdir): Compute with only portable shell.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      041f7c93
  5. 09 1月, 2016 1 次提交
  6. 14 10月, 2015 1 次提交
  7. 13 9月, 2013 1 次提交
  8. 13 8月, 2013 1 次提交
    • E
      tests: add helper to determine when to skip expensive tests · 38d4bf49
      Eric Blake 提交于
      The logic set up in previous patch for exposing VIR_TEST_EXPENSIVE
      to individual tests is as follows:
      
      make check VIR_TEST_EXPENSIVE=0   => getenv("VIR_TEST_EXPENSIVE") sees "0"
      make check VIR_TEST_EXPENSIVE=1   => getenv("VIR_TEST_EXPENSIVE") sees "1"
      make check                        => getenv("VIR_TEST_EXPENSIVE") sees
      either "0" or "1", based on configure options
      cd tests; ./FOOtest               => getenv("VIR_TEST_EXPENSIVE") sees
      whatever is in your environment (usually NULL, but possibly garbage)
      
      Merely checking if VIR_TEST_EXPENSIVE is set in the environment
      does the wrong thing; likewise, it is unsafe to assume the
      variable will always contain a valid number.
      
      As such, it helps to have helper functions, instead of making each
      expensive test repeat the probe of the environment.
      
      * tests/testutils.h (virTestGetExpensive): New prototype.
      * tests/testutils.c (virTestGetExpensive): Implement it.
      * tests/test-lib.sh (very_expensive_): Rename...
      (test_expensive): ...and tweak to use VIR_TEST_EXPENSIVE.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      38d4bf49
  9. 11 7月, 2011 1 次提交
    • E
      tests: simplify formatting · 9693e293
      Eric Blake 提交于
      The shell version would output 40 extra spaces for a test with
      a multiple of 40 sub-tests, and the C version can use the same
      printf optimization for avoiding a loop over single space output
      as the shell version.
      
      * tests/testutils.c (virtTestMain): Avoid loop for alignment.
      * tests/test-lib.sh: Fix formatting when counter is multiple of 40.
      9693e293
  10. 09 7月, 2011 1 次提交
    • M
      tests: Fix compressed test output padding logic · b1c9bf27
      Matthias Bolte 提交于
      The current logic tries to count from 1 to 40 and ignores paddings
      of 0 and 1 to 40. This doesn't work for counter + 1 mod 40 == 0
      like here for counter value 159
      
      TEST: virsh-all
            ........................................ 40
            ........................................ 80
            ........................................ 120
            ....................................... 159 OK
      PASS: virsh-all
      
      Also seq isn't portable. Therefore, calculate the correct padding
      length directly and use printf to output it at once.
      b1c9bf27
  11. 25 3月, 2010 1 次提交
  12. 24 3月, 2010 2 次提交
    • J
      tests: shell script portability and clean-up · ca7db6cb
      Jim Meyering 提交于
      * tests/test-lib.sh: "echo -n" is not portable.  Use printf instead.
      Remove unnecessary uses of "eval-in-subshell" (subshell is sufficient).
      Remove uses of tests' -a operator; it is not portable.
      Instead, use "test cond && test cond2".
      * tests/schematestutils.sh: Replace use of test's -a.
      ca7db6cb
    • M
      tests: Don't add extra padding if counter mod 40 is 0 · 8a7783c1
      Matthias Bolte 提交于
      This change only affects the output of tests that have an exact
      multiple of 40 test cases. For example the domainschematest currently:
      
      TEST: domainschematest
            ........................................ 40
            ........................................ 80
            ........................................ 120
            ........................................ 160
            ........................................                                         200 OK
      PASS: domainschematest
      
      It outputs additional 40 spaces on the last line.
      
      The domainschematest output is fixed by the change in test-lib.sh. The
      change in testutils.c fixes this for tests written in C. Currently no
      C test has an exact multiple of 40 test cases, but I checked it and
      the same problem exists there.
      
      This patch stops that in both cases.
      8a7783c1
  13. 16 1月, 2010 1 次提交
    • D
      Make test suite output less verbose · e8ac4a79
      Daniel P. Berrange 提交于
      Only print out '.' for each test case, full test output can be
      re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX
      
      Sample output now looks like
      
        TEST: statstest
              ........................................ 40
              ...................................      75  OK
        PASS: statstest
        TEST: qparamtest
              ................................         32  OK
        PASS: qparamtest
        TEST:
              ............                             12  OK
      e8ac4a79
  14. 08 4月, 2008 1 次提交
    • J
      Don't fail to read a file because it's non-seekable (e.g., a pipe). · 3ce465f8
      Jim Meyering 提交于
      * src/util.c (fread_file_lim): New function.
      (__virFileReadAll): Use fread_file_lim, rather than requiring
      that stat.st_size provide a usable file size.
      * tests/read-non-seekable: New test, for the above.
      * tests/Makefile.am (test_scripts): Add read-non-seekable.
      * tests/test-lib.sh (mkfifo_or_skip_): New helper function.
      3ce465f8
  15. 24 3月, 2008 1 次提交
    • J
      Add new testing framework and the first test to use it. · f15efcdf
      Jim Meyering 提交于
      * tests/Makefile.am (test_scripts): Add vcpupin.
      (EXTRA_DIST): Add test-lib.sh.
      * tests/test-lib.sh: Testing framework, from coreutils.
      * tests/vcpupin: New file.
      * build-aux/mktempd: New file, from gnulib.
      * bootstrap: Add posix-shell and mktempd to the list of imported modules.
      * gnulib/m4/posix-shell.m4: New file, from gnulib.
      f15efcdf