diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-11-30 00:05:22 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-11-30 17:35:20 +0100 |
commit | 130079ae27b47228516dc2934bcdecca5dbedf12 (patch) | |
tree | e56b3a783bace65282da47730806250443362527 /gnu/tests/install.scm | |
parent | dcd9d1637a90375756c97019cc456b6f948b5d2f (diff) | |
download | patches-130079ae27b47228516dc2934bcdecca5dbedf12.tar patches-130079ae27b47228516dc2934bcdecca5dbedf12.tar.gz |
tests: Create a copy-on-write image instead of copying eagerly.
* gnu/tests/install.scm (qemu-command/writable-image): Invoke 'qemu-img
-o backing_file' instead of calling 'copy-file'.
Diffstat (limited to 'gnu/tests/install.scm')
-rw-r--r-- | gnu/tests/install.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index ecf1ac1923..4779b80e94 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -199,8 +199,15 @@ IMAGE, a disk image. The QEMU VM is has access to MEMORY-SIZE MiB of RAM." (mlet %store-monad ((system (current-system))) (return #~(let ((image #$image)) ;; First we need a writable copy of the image. - (format #t "copying image '~a'...~%" image) - (copy-file image "disk.img") + (format #t "creating writable image from '~a'...~%" image) + (unless (zero? (system* #+(file-append qemu-minimal + "/bin/qemu-img") + "create" "-f" "qcow2" + "-o" + (string-append "backing_file=" image) + "disk.img")) + (error "failed to create writable QEMU image" image)) + (chmod "disk.img" #o644) `(,(string-append #$qemu-minimal "/bin/" #$(qemu-command system)) |