1. 09 9月, 2019 1 次提交
  2. 06 9月, 2019 6 次提交
  3. 04 9月, 2019 1 次提交
  4. 29 8月, 2019 2 次提交
  5. 28 8月, 2019 4 次提交
  6. 27 8月, 2019 9 次提交
  7. 26 8月, 2019 9 次提交
  8. 23 8月, 2019 8 次提交
    • R
      tests: Make references to global symbols indirect in test drivers · f6d6086d
      Roman Bolshakov 提交于
      A library has to be built with -flat_namespace to get all references to
      global symbols indirected. That can also be achieved with two-level
      namespace interposition but we're not using explicit symbol
      interposition since it's more verbose and requires massive changes to
      the mocks.
      
      This provides a way to interpose a mock for virQEMUCapsProbeHostCPU from
      qemucpumock and fixes domaincapstest on macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      f6d6086d
    • R
      tests: Avoid gnulib replacements in mocks · 0ae6f5ce
      Roman Bolshakov 提交于
      gnulib headers change stat, lstat and open to replacement functions,
      even for function definitions. This effectively disables standard
      library overrides in virfilewrapper and virmockstathelpers since they
      are never reached.
      
      Rename the functions and provide a declartion that uses correct
      assembler name for the mocks.
      
      This fixes firmware lookup in domaincapstest on macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      0ae6f5ce
    • R
      tests: Use flat namespace on macOS · fefc4ff4
      Roman Bolshakov 提交于
      Test executables and mocks have assumption that any symbol can be
      replaced with LD_PRELOAD. That's not a case for macOS unless flat
      namespace is used, because every external symbol reference records the
      library to be looked up. And the symbols cannot be replaced unless dyld
      interposing is used.
      
      Setting DYLD_FORCE_FLAT_NAMESPACE changes symbol lookup behaviour to be
      similar to Linux dynamic linker. It's more lightweight solution than
      explicitly decorating all mock symbols as interpositions and building
      libvirt as interposable dynamic library.
      
      This fixes vircryptotest and allows to proceed other tests that rely on
      mocks a little bit further.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      fefc4ff4
    • R
      tests: Lookup extended stat/lstat in mocks · d6b17edd
      Roman Bolshakov 提交于
      macOS syscall interface (/usr/lib/system/libsystem_kernel.dylib) has
      three kinds of stat but only one of them can be used to fill
      "struct stat": stat$INODE64.
      
      virmockstathelpers looks up regular stat instead of stat$INODE64.  That
      causes a failure in qemufirmwaretest because "struct stat" is laid out
      differently from the values returned by stat.
      
      Introduce VIR_MOCK_REAL_INIT_ALIASED that can be used to lookup
      stat$INODE64 and lstat$INODE64 and use it to setup real functions on
      macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      d6b17edd
    • R
      tests: Drop /private CWD prefix in commandhelper · c6b3bf93
      Roman Bolshakov 提交于
      /tmp is a symbolic link to /private/tmp on macOS. That causes failures
      in commandtest, because getcwd returns /private/tmp and the expected
      output doesn't match to "CWD: /tmp".
      
      Rathern than making a copy of commanddata solely for macOS, the /private
      prefix is stripped.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      c6b3bf93
    • R
      tests: Remove -module flag for mocks · 647c6518
      Roman Bolshakov 提交于
      macOS has two kinds of loadable libraries: MH_BUNDLE, and MH_DYLIB.
      bundle is used for plugins that are loaded with dlopen/dlsym/dlclose.
      And there's no way to preload a bundle into an application. dynamic
      linker (dyld) will reject it when finds it in DYLD_INSERT_LIBRARIES.
      
      Unfortunately, a bundle is built if -module flag is provided to libtool.
      The flag has been removed to build dylibs with ".dylib" suffix.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      647c6518
    • R
      tests: Add lib- prefix to all mocks · fde36108
      Roman Bolshakov 提交于
      In preparation libtool "-module" flag removal, add lib prefix to all
      mock shared objects.
      
      While at it, introduce VIR_TEST_MOCK macros that makes path out of mock
      name to be used with VIR_TEST_PRELOAD or VIR_TEST_MAIN_PRELOAD.  That,
      hopefully, improves readability, reduces line length and allows to
      tailor VIR_TEST_MOCK for specific platform if it has shared library
      suffix different from ".so".
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      fde36108
    • R
      tests: Preload mocks with DYLD_INSERT_LIBRARIES on macOS · 351492e3
      Roman Bolshakov 提交于
      LD_PRELOAD has no effect on macOS. Instead, dyld(1) provides a way for
      symbol hooking via DYLD_INSERT_LIBRARIES. The variable should contain
      colon-separated paths to the dylibs to be inserted.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      351492e3