1. 09 5月, 2017 2 次提交
    • R
      tests: fix virfilewrapper · 058bf554
      Roman Bogorodskiy 提交于
      If __lxstat() and __xstat() functions are not available, build fails with:
      
        CC       virfilewrapper.o
      virfilewrapper.c:180:5: error: no previous prototype for function '__lxstat' [-Werror,-Wmissing-prototypes]
      int __lxstat(int ver, const char *path, struct stat *sb)
          ^
      virfilewrapper.c:208:5: error: no previous prototype for function '__xstat' [-Werror,-Wmissing-prototypes]
      int __xstat(int ver, const char *path, struct stat *sb)
      
      Luckily, we already check presence of these functions in configure
      using AC_CHECK_FUNCS, so just don't wrap these if they're not available.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      058bf554
    • M
      tests: Add virfilewrapper -- the new super "mock" · ae60ea48
      Martin Kletzander 提交于
      This mock (which is actually not mock at all, see later) can redirect
      all accesses to a path into another path.  There is no need to
      create mocks for particular directories, you just create a directory
      with all the data a redirect the test there.
      
      In the future, this should also be able to register callbacks for
      calls/paths, e.g. when the test is going to write into anything under
      "/sys/devices", call function fce();  Then in the open() call we would
      add information about the fd into some structure and in write() we
      would call fce() with parameters like @path to write to, @data to
      be written and pointer to optional return value, so that fce() itself
      could stop the call from happening or change its behaviour.  But
      that's an idea for a latter day.
      
      This is not a mock because it will not be preloaded, but compiled in
      the test itself.  See future patches for usage.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      ae60ea48