On Mon, Jul 06, 2020 at 14:20:25 -0400, Masayoshi Mizuma wrote: > From: Masayoshi Mizuma <m.mizuma@xxxxxxxxxxxxxx> > > Add a unit test for transient option for qcow2 file. > > Signed-off-by: Masayoshi Mizuma <m.mizuma@xxxxxxxxxxxxxx> > --- > tests/qemublocktest.c | 10 ++++++++++ > .../xml2json/qcow2-transient-srconly.json | 9 +++++++++ > .../qemublocktestdata/xml2json/qcow2-transient.json | 13 +++++++++++++ > .../qemublocktestdata/xml2json/qcow2-transient.xml | 13 +++++++++++++ > 4 files changed, 45 insertions(+) > create mode 100644 tests/qemublocktestdata/xml2json/qcow2-transient-srconly.json > create mode 100644 tests/qemublocktestdata/xml2json/qcow2-transient.json > create mode 100644 tests/qemublocktestdata/xml2json/qcow2-transient.xml > > diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c > index 0cdedb9..1294c18 100644 > --- a/tests/qemublocktest.c > +++ b/tests/qemublocktest.c > @@ -266,6 +266,7 @@ testQemuDiskXMLToProps(const void *opaque) > g_autoptr(virJSONValue) formatProps = NULL; > g_autoptr(virJSONValue) storageProps = NULL; > g_autoptr(virJSONValue) storageSrcOnlyProps = NULL; > + qemuDomainObjPrivate priv; > g_autofree char *xmlpath = NULL; > g_autofree char *xmlstr = NULL; > > @@ -288,6 +289,13 @@ testQemuDiskXMLToProps(const void *opaque) > return -1; > } > > + if (disk->transient) { > + priv.driver = data->driver; > + if (qemuBlockCreateTransientDisk(disk->src, &priv) < 0) NACK, this would create files on the system running the test suite in random paths according to the disk config. The test-suite must never do that.