e821de2 tests: fix virpcitest with read-only srcdir

Authored and Committed by ericb 10 years ago
    tests: fix virpcitest with read-only srcdir
    
    'make distcheck' has been broken since commit 21685c9; basically,
    it emulates the case of a read-only $(srcdir) (such as building
    from a tarball exploded onto a CD-ROM), but we were creating our
    fake pci device as a symlink into $(srcdir) and failing when that
    requires opening the config file for writing:
    
     3) testVirPCIDeviceReset                                             ... libvirt:  error : Failed to open config space file '/sys/bus/pci/devices/0000:00:01.0/config': Permission denied
    
    Fix it by copying rather than symlinking.
    
    * tests/virpcimock.c (make_file): Add parameter to allow binary
    creation; adjust all callers.
    (pci_device_new_from_stub): Copy rather than symlink.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+27 -16