diff options
Diffstat (limited to 'gnu/tests')
| -rw-r--r-- | gnu/tests/base.scm | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 86fa6374efc..403aa20cfff 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm | |||
| @@ -24,7 +24,8 @@ | |||
| 24 | #:use-module (gnu tests) | 24 | #:use-module (gnu tests) |
| 25 | #:use-module (gnu image) | 25 | #:use-module (gnu image) |
| 26 | #:use-module (gnu system) | 26 | #:use-module (gnu system) |
| 27 | #:autoload (gnu system image) (system-image) | 27 | #:use-module (gnu system file-systems) |
| 28 | #:autoload (gnu system image) (system-image qcow2-image-type) | ||
| 28 | #:use-module (gnu system privilege) | 29 | #:use-module (gnu system privilege) |
| 29 | #:use-module (gnu system shadow) | 30 | #:use-module (gnu system shadow) |
| 30 | #:use-module (gnu system vm) | 31 | #:use-module (gnu system vm) |
| @@ -61,6 +62,8 @@ | |||
| 61 | %test-cleanup | 62 | %test-cleanup |
| 62 | %test-activation | 63 | %test-activation |
| 63 | 64 | ||
| 65 | %test-missing-file-system | ||
| 66 | |||
| 64 | %hello-dependencies-manifest | 67 | %hello-dependencies-manifest |
| 65 | guix-daemon-test-cases | 68 | guix-daemon-test-cases |
| 66 | %test-guix-daemon | 69 | %test-guix-daemon |
| @@ -1357,3 +1360,52 @@ runs unprivileged.") | |||
| 1357 | #:imported-modules '((gnu services herd) | 1360 | #:imported-modules '((gnu services herd) |
| 1358 | (guix combinators))))) | 1361 | (guix combinators))))) |
| 1359 | (run-guix-daemon-test os "guix-daemon-unprivileged-test"))))) | 1362 | (run-guix-daemon-test os "guix-daemon-unprivileged-test"))))) |
| 1363 | |||
| 1364 | (define %test-missing-file-system | ||
| 1365 | (system-test | ||
| 1366 | (name "missing-file-system") | ||
| 1367 | (description | ||
| 1368 | "Test that boot does not fail when a file system that might fail | ||
| 1369 | is specified and isn't provided by any device.") | ||
| 1370 | (value | ||
| 1371 | (let* ((os (marionette-operating-system | ||
| 1372 | (operating-system | ||
| 1373 | (inherit %simple-os) | ||
| 1374 | (kernel-arguments (list "console=ttyS0,115200")) | ||
| 1375 | (file-systems | ||
| 1376 | (cons* (file-system | ||
| 1377 | (device (uuid "abcdef12-3456-7890-abcd-ef1234567890")) | ||
| 1378 | (mount-point "/somewhere/1") | ||
| 1379 | (mount? #t) | ||
| 1380 | (mount-may-fail? #t) | ||
| 1381 | (type "ext4")) | ||
| 1382 | (file-system | ||
| 1383 | (device (file-system-label "missing-fs")) | ||
| 1384 | (mount-point "/somewhere/2") | ||
| 1385 | (mount? #t) | ||
| 1386 | (mount-may-fail? #t) | ||
| 1387 | (type "ext4")) | ||
| 1388 | (file-system | ||
| 1389 | (device "/dev/missing") | ||
| 1390 | (mount-point "/somewhere/3") | ||
| 1391 | (mount? #t) | ||
| 1392 | (mount-may-fail? #t) | ||
| 1393 | (type "ext4")) | ||
| 1394 | (file-system | ||
| 1395 | (device (file-system-label "my-root")) | ||
| 1396 | (mount-point "/") | ||
| 1397 | (type "ext4")) | ||
| 1398 | %base-file-systems))) | ||
| 1399 | #:imported-modules '((gnu services herd) | ||
| 1400 | (guix combinators)))) | ||
| 1401 | (image (system-image (os->image os #:type qcow2-image-type))) | ||
| 1402 | (command | ||
| 1403 | #~`(,(string-append #$qemu-minimal "/bin/" (qemu-command)) | ||
| 1404 | ,@(if (file-exists? "/dev/kvm") | ||
| 1405 | '("-enable-kvm") | ||
| 1406 | '()) | ||
| 1407 | "-m" "1024" ;memory size, in MiB | ||
| 1408 | "-serial" "stdio" | ||
| 1409 | "-snapshot" ;for volatile root, writable overlay | ||
| 1410 | "-drive" ,(format #f "file=~a,if=virtio" #$image)))) | ||
| 1411 | (run-basic-test os command name))))) | ||
