summary refs log tree commit diff
path: root/nixos/lib
Commit message (Collapse)AuthorAge
* Document the makeTest length restrictionMichael Fellinger2018-02-20
|
* Only allow test names of up to 50 charactersMichael Fellinger2018-02-20
|
* Merge pull request #34795 from oxij/os/nixosLabel-pt2Michael Raskin2018-02-19
|\ | | | | nixos: labels part 2
| * nixos: rename config.system.nixos* -> config.system.nixos.*Jan Malakhovski2018-02-18
| |
* | nixos/networking-interfaces: rename IP addresses/routes optionsrnhmjoj2018-02-17
|/
* nixos/testing: use the same qemu in the test driverFranz Pletz2018-02-11
| | | | The qemu_test package is also used for running a NixOS qemu VM.
* Add setFunctionArgs lib function.Shea Levy2018-01-31
| | | | | | Among other things, this will allow *2nix tools to output plain data while still being composable with the traditional callPackage/.override interfaces.
* runInLinuxVM: Use QEMU command line that works on other architecturesTuomas Tynkkynen2018-01-30
| | | | | ... by moving the existing definition to qemu-flags.nix and reusing that.
* nixos/qemu: Deduplicate QEMU serialDevice into qemu-flags.nixTuomas Tynkkynen2018-01-30
|
* nixos/qemu-flags: Take a 'pkgs' parameterTuomas Tynkkynen2018-01-30
| | | | I'm gonna use it in the next commit.
* nixos/make-disk-image.nix: Support EFI imagesTuomas Tynkkynen2018-01-22
| | | | | | | | | | | | | | | | | | | | - 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.
* Merge pull request #33577 from dtzWill/fix/cross-2John Ericson2018-01-09
|\ | | | | Minor cross fixes, 2
| * make-ext4-fs: Dependencies are nativeBuildInputsBen Gamari2018-01-09
| |
| * makeSquashfs: Inputs are nativeBuildInputsBen Gamari2018-01-09
| |
* | Merge pull request #32845 from Ma27/test-driver/allow-user-unitsJörg Thalheim2018-01-04
|\ \ | |/ |/| test-driver: support testing user units
| * test-driver: support testing user unitsMaximilian Bosch2018-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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"); ''; }) ```
* | make-disk-image.nix: Really fix write permissions in the storeTuomas Tynkkynen2017-12-20
| | | | | | | | | | 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...
* | make-disk-image.nix: Remove write permissions from /nix/storeTuomas Tynkkynen2017-12-17
|/ | | | | | | | | | | 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
* make-squashfs.nix: Improve invalid path check messagesTuomas Tynkkynen2017-12-15
| | | | | | | Now the mtime problems are gone, but EC2 Hydra builders are still having some problems: https://hydra.nixos.org/build/66043835
* build-support/vm: Use devtmpfs, not static device nodesTuomas Tynkkynen2017-12-12
| | | | In 2017, there is no reason to create a static /dev.
* make-squashfs: Hack to avoid building images where nixos-install won't runTuomas Tynkkynen2017-12-03
| | | | https://github.com/NixOS/nixpkgs/issues/32242
* nixos/qemu: Add virtio-rng-pci to test-driverTuomas Tynkkynen2017-11-26
| | | | Otherwise AArch64 KVM guests don't have enough entropy at boot.
* nixos/testing: fix after --set ceased to evaluate the valueOrivej Desh2017-11-19
|
* make-disk-image: fix evalOrivej Desh2017-11-13
|
* make-disk-image: embed compression switch into the format nameOrivej Desh2017-11-12
|
* make-disk-image: add compressed option to compress qcow2 imagesOrivej Desh2017-11-12
|
* make-disk-image: clean upOrivej Desh2017-11-12
|
* make-disk-image: do not use faketimeOrivej Desh2017-11-11
| | | | | | | 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.
* make-disk-image: clean upOrivej Desh2017-11-11
|
* make-disk-iamge: use faketime to get a consistent timestampDan Peebles2017-11-10
| | | | | | | | | | | | | 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.
* Revert "nixos/test-instrumentation: softcode DISPLAY"Joerg Thalheim2017-11-08
| | | | | | | | This reverts commit 4531ec59551fa3f3c9dfb442dff2ec669c467922. This broke waitForX: https://github.com/NixOS/nixpkgs/commit/b11ac5d29dcccdb7474a23ac1d8a6c40553adcd5#commitcomment-25486347 cc @Lassulus
* nixos/test-instrumentation: softcode DISPLAYlassulus2017-11-07
|
* Merge pull request #30166 from LumiGuide/graphite-1.0.2Peter Simons2017-10-18
|\ | | | | Fix graphite crash by upgrading from 0.9.15 -> 1.0.2
| * graphite: 0.9.15 -> 1.0.2Bas van Dijk2017-10-08
| | | | | | | | | | | | | | | | | | | | Fixes: #29961 Also added the option: services.graphite.web.extraConfig for configuring graphite_web.
* | nixos: run parted with --script optionBjørn Forsman2017-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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".
* | nixos: Fix output path generation of runInMachineaszlig2017-10-11
|/ | | | | | | | | | | | | | | | | | 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>
* Deduplicate some filterSource invocationsDan Peebles2017-08-29
| | | | | | | | | 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 ;)
* amazon-image: support VPC/VHD as an output format for the builderDan Peebles2017-08-10
|
* make-ext4-fs: Fix modification timestamps in imageTuomas Tynkkynen2017-07-29
| | | | | Use '-f' to make timestamp calls to always return the same time. Also Nix uses the timestamp of '1' instead of epoch directly.
* nixos tests: waitForWindow: output a list of windows we see prior to the ↵Graham Christensen2017-06-20
| | | | | | | | | 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
* nixos tests: waitForText: output the detected screen content prior to the ↵Graham Christensen2017-06-20
| | | | | | | | | | | | | | | | | | | 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
* nixos tests: waitUntilTTYMatches: Log TTY contents on last tryGraham Christensen2017-06-20
| | | | | | | | | | | | | | | 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.
* nixos tests: retry: Count down to 0, and pass remaining attempts to the subGraham Christensen2017-06-20
| | | | Allows test functions to output diagnostic information on failure.
* NixOS VM tests: Don't create a setgid group in vde_switchEelco Dolstra2017-06-07
| | | | | | Nix no longer allows this for security reasons. http://hydra.nixos.org/build/53993125
* test-driver: sendKeys() support for capital lettersVolth2017-05-19
|
* make-disk-image: change to be less VM-centricDan Peebles2017-04-24
| | | | | | | | | | 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.
* nixos/testing: Improve quality of OCRaszlig2017-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tesseract: Reintroduce enableLanguagesaszlig2017-04-11
| | | | | | | | | | | | | | | | | | | | | | | 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>
* makeTest: don't rely on makeWrapper not quoting newlinesNikolay Amiantov2017-03-20
|
* make-disk-image.nix: set last fsck time on ext4 images to enable ↵Dan Peebles2017-02-26
| | | | resize-on-startup