about summary refs log tree commit diff
path: root/nixos/lib
AgeCommit message (Collapse)AuthorFilesLines
2018-02-20Document the makeTest length restrictionMichael Fellinger1-0/+4
2018-02-20Only allow test names of up to 50 charactersMichael Fellinger1-1/+9
2018-02-19Merge pull request #34795 from oxij/os/nixosLabel-pt2Michael Raskin1-2/+2
nixos: labels part 2
2018-02-18nixos: rename config.system.nixos* -> config.system.nixos.*Jan Malakhovski1-2/+2
2018-02-17nixos/networking-interfaces: rename IP addresses/routes optionsrnhmjoj1-2/+2
2018-02-11nixos/testing: use the same qemu in the test driverFranz Pletz1-1/+1
The qemu_test package is also used for running a NixOS qemu VM.
2018-01-31Add setFunctionArgs lib function.Shea Levy1-1/+1
Among other things, this will allow *2nix tools to output plain data while still being composable with the traditional callPackage/.override interfaces.
2018-01-30runInLinuxVM: Use QEMU command line that works on other architecturesTuomas Tynkkynen1-0/+6
... by moving the existing definition to qemu-flags.nix and reusing that.
2018-01-30nixos/qemu: Deduplicate QEMU serialDevice into qemu-flags.nixTuomas Tynkkynen1-0/+4
2018-01-30nixos/qemu-flags: Take a 'pkgs' parameterTuomas Tynkkynen2-1/+2
I'm gonna use it in the next commit.
2018-01-22nixos/make-disk-image.nix: Support EFI imagesTuomas Tynkkynen1-18/+64
- Add a new parameter `imageType` that can specify either "efi" or "legacy" (the default which should see no change in behaviour by this patch). - EFI images get a GPT partition table (instead of msdos) with a mandatory ESP partition (so we add an assert that `partitioned` is true). - Use the partx tool from util-linux to determine exact start + size of the root partition. This is required because GPT stores a secondary partition table at the end of the disk, so we can't just have mkfs.ext4 create the filesystem until the end of the disk. - (Unrelated to any EFI changes) Since we're depending on the `-E offset=X` option to mkfs which is only supported by e2fsprogs, disallow any attempts of creating partitioned disk images where the root filesystem is not ext4.
2018-01-09Merge pull request #33577 from dtzWill/fix/cross-2John Ericson2-2/+2
Minor cross fixes, 2
2018-01-09make-ext4-fs: Dependencies are nativeBuildInputsBen Gamari1-1/+1
2018-01-09makeSquashfs: Inputs are nativeBuildInputsBen Gamari1-1/+1
2018-01-04Merge pull request #32845 from Ma27/test-driver/allow-user-unitsJörg Thalheim1-9/+19
test-driver: support testing user units
2018-01-02test-driver: support testing user unitsMaximilian Bosch1-9/+19
It is quite complicated to test services using the test-driver when declaring user services with `systemd.user.services` such as many X11-based services like `xautolock.service`. This change adds an optional `$user` parameter to each systemd-related function in the test-driver and runs `systemctl --user` commands using `su -l $user -c ...` and sets the `XDG_RUNTIME_DIR` variable accordingly and a new function named `systemctl` which is able to run a systemd command with or without a specified user. The change can be confirmed with a simple VM declaration like this: ``` import ./nixos/tests/make-test.nix ({ pkgs, lib }: with lib; { name = "systemd-user-test"; nodes.machine = { imports = [ ./nixos/tests/common/user-account.nix ]; services.xserver.enable = true; services.xserver.displayManager.auto.enable = true; services.xserver.displayManager.auto.user = "bob"; services.xserver.xautolock.enable = true; }; testScript = '' $machine->start; $machine->waitForX; $machine->waitForUnit("xautolock.service", "bob"); $machine->stopJob("xautolock.service", "bob"); $machine->startJob("xautolock.service", "bob"); $machine->systemctl("list-jobs --no-pager", "bob"); $machine->systemctl("show 'xautolock.service' --no-pager", "bob"); ''; }) ```
2017-12-20make-disk-image.nix: Really fix write permissions in the storeTuomas Tynkkynen1-1/+1
I think the current one applies the -exec only to those that match '-type d'. Let's switch it to something that humans can understand...
2017-12-17make-disk-image.nix: Remove write permissions from /nix/storeTuomas Tynkkynen1-0/+3
Fakeroot seems to always give the owner write bit to any files touched inside it (presumably to easily simulate the fact that root can still modify such files). So do an explicit chmod to remove them. This should finally solve #32242 after the EC2 images are regenerated with this change. https://hydra.nixos.org/build/66143116
2017-12-15make-squashfs.nix: Improve invalid path check messagesTuomas Tynkkynen1-1/+1
Now the mtime problems are gone, but EC2 Hydra builders are still having some problems: https://hydra.nixos.org/build/66043835
2017-12-12build-support/vm: Use devtmpfs, not static device nodesTuomas Tynkkynen1-2/+0
In 2017, there is no reason to create a static /dev.
2017-12-03make-squashfs: Hack to avoid building images where nixos-install won't runTuomas Tynkkynen1-0/+27
https://github.com/NixOS/nixpkgs/issues/32242
2017-11-26nixos/qemu: Add virtio-rng-pci to test-driverTuomas Tynkkynen1-0/+1
Otherwise AArch64 KVM guests don't have enough entropy at boot.
2017-11-19nixos/testing: fix after --set ceased to evaluate the valueOrivej Desh1-2/+1
2017-11-13make-disk-image: fix evalOrivej Desh1-1/+1
2017-11-12make-disk-image: embed compression switch into the format nameOrivej Desh1-6/+6
2017-11-12make-disk-image: add compressed option to compress qcow2 imagesOrivej Desh1-1/+6
2017-11-12make-disk-image: clean upOrivej Desh1-7/+6
2017-11-11make-disk-image: do not use faketimeOrivej Desh1-11/+3
Since https://github.com/lkl/linux/pull/394 cptofs preserves the source time, which is 1970-01-01T00:00:01Z for /nix/store and recent for other files. This reverts commit f5b3f2c5a7f2b51e80ac32fb47fd1d7d3e475ad1.
2017-11-11make-disk-image: clean upOrivej Desh1-5/+6
2017-11-10make-disk-iamge: use faketime to get a consistent timestampDan Peebles1-3/+11
This fixes #28768 because during an image build, Nix sees bad store timestamps and attempts to fix them, but can't fix them on a running system (due to being inside a builder). Since timestamps on the store are supposed to be 1 anyway, if we fix this, that fixes image building inside booted images made this way. Note that this adds quite a bit of noise to the output, because running `cptofs` under `faketime` causes a bunch of seemingly spurious error messages and my attempts to suppress them all failed. We'll fix it when `cptofs` gets a native timestamp preservation feature.
2017-11-08Revert "nixos/test-instrumentation: softcode DISPLAY"Joerg Thalheim1-4/+1
This reverts commit 4531ec59551fa3f3c9dfb442dff2ec669c467922. This broke waitForX: https://github.com/NixOS/nixpkgs/commit/b11ac5d29dcccdb7474a23ac1d8a6c40553adcd5#commitcomment-25486347 cc @Lassulus
2017-11-07nixos/test-instrumentation: softcode DISPLAYlassulus1-1/+4
2017-10-18Merge pull request #30166 from LumiGuide/graphite-1.0.2Peter Simons1-0/+11
Fix graphite crash by upgrading from 0.9.15 -> 1.0.2
2017-10-14nixos: run parted with --script optionBjørn Forsman1-1/+1
-s, --script: never prompts for user intervention Sometimes the NixOS installer tests fail when they invoke parted, e.g. https://hydra.nixos.org/build/62513826/nixlog/1. But instead of exiting right there, the tests hang until the Nix builder times out (and kills the build). With this change the tests would instead fail immediately, which is preferred. While at it, use "parted --script" treewide, so nobody gets build timeout due to parted error (or misuse). (Only nixos/ use it, and only non-interactive.) A few instances already use the short option "-s", convert them to long option "--short".
2017-10-11nixos: Fix output path generation of runInMachineaszlig1-0/+1
Regression introduced by a02bb00156086b45e68c1112008db506734f8649. The fix is done by disabling writableStore, because the latter will set up an overlayfs on the Nix store within the VM, which in turn will discard all the outputs of the resulting output path. However in runInMachine we actually *want* the contents of the generated path and also don't want a writable store within the VM (except of course for $out, which is writable anyway). I've added a small regression test to verifify the output in nixos/tests/run-in-machine.nix to make sure this won't break again in the future. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-10-08graphite: 0.9.15 -> 1.0.2Bas van Dijk1-0/+11
Fixes: #29961 Also added the option: services.graphite.web.extraConfig for configuring graphite_web.
2017-08-29Deduplicate some filterSource invocationsDan Peebles1-13/+1
This version should have more conventional regexes that work across many platforms and regex engines. This is an issue because up until Nix 1.11, Nix called out to the libc regex matcher, which behaved differently on Darwin and Linux. And in Nix 1.12, we're moving to std::regex which will also behave differently here. And yes, I do actually evaluate make-disk-image.nix on Darwin ;)
2017-08-10amazon-image: support VPC/VHD as an output format for the builderDan Peebles1-2/+8
2017-07-29make-ext4-fs: Fix modification timestamps in imageTuomas Tynkkynen1-2/+2
Use '-f' to make timestamp calls to always return the same time. Also Nix uses the timestamp of '1' instead of epoch directly.
2017-06-20nixos tests: waitForWindow: output a list of windows we see prior to the ↵Graham Christensen1-0/+7
final check machine: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d' machine: exit status 0 machine: Last chance to match /(?^:dfiirst configuration)/ on the the window list, which currently contains: machine: [i3 con] container around 0xf8a5f0, i3: first configuration, [i3 con] floatingcon around 0xf8c260, [i3 con] container around 0xf8a380, i3bar for output Virtual-1, [i3 con] bottom dockarea Virtual-1, [i3 con] workspace 1, [i3 con] content Virtual-1, [i3 con] top dockarea Virtual-1, [i3 con] output Virtual-1, [i3 con] workspace __i3_scratch, [i3 con] content __i3, [i3 con] pseudo-output __i3, i3
2017-06-20nixos tests: waitForText: output the detected screen content prior to the ↵Graham Christensen1-0/+6
last attempt machine: Last chance to match /(?^:BALICE)/ on the screen, which currently contains: machine: performing optical character recognition machine: sending monitor command: screendump /tmp/nix-build-vm-test-run-sddm.drv-0/ocrin.ppm machine: Session Layout O O 0 1 : 0 9 Wednesday, June 21, 2017 |_ I Select your user and enter password
2017-06-20nixos tests: waitUntilTTYMatches: Log TTY contents on last tryGraham Christensen1-0/+6
If the test has not passed yet, on the last attempt it now outputs: machine: Last chance to match /logine: / on TTY2, which currently contains: machine: running command: fold -w$(stty -F /dev/tty2 size | awk '{print $2}') /dev/vcs2 machine: exit status 0 machine: <<< Welcome to NixOS 17.09.git.a804ef4 (x86_64) - tty2 >>> machine login: to help debug the problem. Notice the "logine" typo in my check.
2017-06-20nixos tests: retry: Count down to 0, and pass remaining attempts to the subGraham Christensen1-2/+2
Allows test functions to output diagnostic information on failure.
2017-06-07NixOS VM tests: Don't create a setgid group in vde_switchEelco Dolstra1-1/+1
Nix no longer allows this for security reasons. http://hydra.nixos.org/build/53993125
2017-05-19test-driver: sendKeys() support for capital lettersVolth1-23/+13
2017-04-24make-disk-image: change to be less VM-centricDan Peebles1-81/+123
This changes much of the make-disk-image.nix logic (and thus most NixOS image building) to use LKL to set up the target directory structure rather than a Linux VM. The only work we still do in a VM is less IO-heavy stuff that while still time-consuming, is less of the overall load. The goal is to kill more of that stuff, but that will require deeper changes to NixOS activation scripts and switch-to-configuration.pl, and I don't want to bite off too much at once.
2017-04-11nixos/testing: Improve quality of OCRaszlig2-9/+14
First of all, we're now using ImageMagick to improve the screenshot so that Tesseract has an esier time to recognize the text. The resulting image of this post-processing is a scaled up black-and-white version with the backgrounds almost entirely removed and the text edges a bit blurred, so the screen shots now more or less resemble an image from a scanner rather. This is what Tesseract is trained for by default. As mentioned in the previous commit we now also use Tesseract 4, which further improves the quality of text recognition. I've spent countless hours just to test different postprocessing variants and testing what works best for our tests and this is the one that worked best so far. It's certainly not perfect and I'd like to avoid the scaling step but we're way better off than before. In addition to this, the OCR process is now done without an intermediate file, solely using pipes. I've tested this using the following VM tests which have OCR enabled: * nixos/tests/chromium.nix -A stable * nixos/tests/emacs-daemon.nix * nixos/tests/installer.nix -A luksroot * nixos/tests/lightdm.nix * nixos/tests/plasma5.nix * nixos/tests/sddm.nix All of the tests still succeed and comparing some of the recognition results to the earlier results it now also detects a lot more text than before this commit. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-04-11tesseract: Reintroduce enableLanguagesaszlig1-1/+1
I've removed that attribute in 68bc260ca2d71a676dd6afdb3524d4fff483016b, because the language files no longer were distributed as seperate files, but if we for example only want to use the English training data, the closure size of Tesseract gets quite large (around 1.2 GB), which is a bit much just to be able to run NixOS VM tests. For this reason I've also switched the VM tests back to using only the English language. Tested using the following VM tests (the ones that have OCR enabled) on x86_64-linux: * nixos/tests/chromium.nix -A stable * nixos/tests/emacs-daemon.nix * nixos/tests/installer.nix -A luksroot * nixos/tests/lightdm.nix * nixos/tests/plasma5.nix * nixos/tests/sddm.nix Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-03-20makeTest: don't rely on makeWrapper not quoting newlinesNikolay Amiantov1-3/+3
2017-02-26make-disk-image.nix: set last fsck time on ext4 images to enable ↵Dan Peebles1-2/+4
resize-on-startup