diff options
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r-- | regress/usr.sbin/vmd/diskfmt/Makefile | 7 | ||||
-rw-r--r-- | regress/usr.sbin/vmd/diskfmt/vioscribble.c | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/regress/usr.sbin/vmd/diskfmt/Makefile b/regress/usr.sbin/vmd/diskfmt/Makefile index c2a5f42d5f6..33ac4c6cf18 100644 --- a/regress/usr.sbin/vmd/diskfmt/Makefile +++ b/regress/usr.sbin/vmd/diskfmt/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 2018/09/09 04:25:32 ccardenas Exp $ +# $OpenBSD: Makefile,v 1.2 2018/10/08 16:32:01 reyk Exp $ # This regression test creates a raw disk image and a # qcow disk image, and scribbles the same data to both @@ -11,7 +11,7 @@ VMD_DIR=$(BSDSRCDIR)/usr.sbin/vmd/ PROG=vioscribble -SRCS=vioscribble.c $(VMD_DIR)/vioqcow2.c $(VMD_DIR)/vioraw.c +SRCS=vioscribble.c vioqcow2.c vioraw.c CFLAGS+=-I$(VMD_DIR) -pthread LDFLAGS+=-pthread @@ -26,3 +26,6 @@ scribble-images: .PHONY: ${REGRESS_TARGETS} scribble-images .include <bsd.regress.mk> + +vioqcow2.c vioraw.c: $(VMD_DIR)/vioqcow2.c $(VMD_DIR)/vioraw.c + cp $(VMD_DIR)/vioqcow2.c $(VMD_DIR)/vioraw.c . diff --git a/regress/usr.sbin/vmd/diskfmt/vioscribble.c b/regress/usr.sbin/vmd/diskfmt/vioscribble.c index 14d720db652..0152b8d4bb4 100644 --- a/regress/usr.sbin/vmd/diskfmt/vioscribble.c +++ b/regress/usr.sbin/vmd/diskfmt/vioscribble.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioscribble.c,v 1.1 2018/09/09 04:25:32 ccardenas Exp $ */ +/* $OpenBSD: vioscribble.c,v 1.2 2018/10/08 16:32:01 reyk Exp $ */ /* * Copyright (c) 2018 Ori Bernstein <ori@eigenstate.org> @@ -122,16 +122,18 @@ main(int argc, char **argv) verbose = !!getenv("VERBOSE"); qcfd = open("scribble.qc2", O_RDWR); rawfd = open("scribble.raw", O_RDWR); - if (qcfd == -1 || virtio_init_qcow2(&qcowfile, &qcsz, qcfd) == -1) + if (qcfd == -1) err(1, "unable to open qcow"); - if (rawfd == -1 || virtio_init_raw(&rawfile, &rawsz, rawfd) == -1) + if (virtio_init_qcow2(&qcowfile, &qcsz, &qcfd, 1) == -1) + err(1, "unable to init qcow"); + if (rawfd == -1 || virtio_init_raw(&rawfile, &rawsz, &rawfd, 1) == -1) err(1, "unable to open raw"); srandom_deterministic(123); /* scribble to both disks */ printf("scribbling...\n"); - for (i = 0; i < 16; i++) { + for (i = 0; i < 1024*16; i++) { off = (random() % DISKSZ); len = random() % sizeof buf + 1; fill(off, buf, sizeof buf); |