tests: Fix PCI test data filenames for Windows

Windows doesn't allow : in filenames.

Commit 21685c955e added files with a : in
their names. This broke git operations on Windows as git is not able to
create those files on clone or pull.

Replace : with - in the offending filenames and adapt the test case.
This commit is contained in:
Matthias Bolte 2014-01-22 22:26:48 +01:00
parent 46a0737e13
commit 96f274a989
11 changed files with 18 additions and 1 deletions

View File

@ -320,16 +320,33 @@ pci_device_new_from_stub(const struct pciDevice *data)
{
struct pciDevice *dev;
char *devpath;
char *id;
char *c;
char *configSrc;
char tmp[32];
struct stat sb;
if (VIR_STRDUP_QUIET(id, data->id) < 0)
ABORT_OOM();
/* Replace ':' with '-' to create the config filename from the
* device ID. The device ID cannot be used directly as filename
* because it contains ':' and Windows does not allow ':' in
* filenames. */
c = strchr(id, ':');
while (c) {
*c = '-';
c = strchr(c, ':');
}
if (VIR_ALLOC_QUIET(dev) < 0 ||
virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config",
abs_srcdir, data->id) < 0 ||
abs_srcdir, id) < 0 ||
virAsprintfQuiet(&devpath, "%s/devices/%s", fakesysfsdir, data->id) < 0)
ABORT_OOM();
VIR_FREE(id);
memcpy(dev, data, sizeof(*dev));
if (virFileMakePath(devpath) < 0)