Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixosTests.installer: Increase memory allocated to the VM #111495

Merged
merged 1 commit into from Feb 2, 2021

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Jan 31, 2021

Motivation for this change

Fixes #111223.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Fixes NixOS#111223.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@andersk andersk added 1.severity: channel blocker Blocks a channel 11.by: nixpkgs-member 6.topic: testing Tooling for automated testing of packages and modules labels Jan 31, 2021
Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Confirmed locally to fix that test on x86_64.

@SuperSandro2000
Copy link
Member

@ofborg eval

@vcunat
Copy link
Member

vcunat commented Feb 1, 2021

It doesn't seem too important, but how's the i686 case for you? I'm getting stuck on

vm-test-run-installer-luksroot-format1> boot-after-install: starting vm

both before and after this PR (and even if I increase it to 1024 as well).

@andersk
Copy link
Contributor Author

andersk commented Feb 1, 2021

@vcunat If I make it so qemu’s stderr doesn’t disappear into the ether:

--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -748,7 +748,6 @@ class Machine:
             self.script,
             stdin=subprocess.DEVNULL,
             stdout=subprocess.PIPE,
-            stderr=subprocess.STDOUT,
             shell=True,
             cwd=self.state_dir,
             env=environment,

I see this error from the i686 test:

machine # [  450.464576] reboot: Power down
(4.72 seconds)
(5.25 seconds)
deleting VM state directory /tmp/vm-state-boot-after-install
if you want to keep the VM state, pass --keep-vm-state
boot-after-install: starting vm
qemu-system-i386: -enable-kvm: unsupported machine type
Use -machine help to list supported machines

The -enable-kvm actually comes from two places.

  1. In the qemu-kvm wrapper:

    start_command = (
    "qemu-kvm -m 384 " + net_backend + " " + net_frontend + " $QEMU_OPTS "
    )

    # Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
    postInstall = ''
    if [ -x $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} ]; then
    makeWrapper $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} \
    $out/bin/qemu-kvm \
    --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"
    fi
    '';

    (Note that i386 is indeed the “host platform” here since we’re overriding system.)

  2. In the test:

    def assemble_qemu_flags():
    flags = "-cpu max"
    ${if system == "x86_64-linux"
    then ''flags += " -m 768"''
    else ''flags += " -m 512 -enable-kvm -machine virt,gic-version=host"''
    }
    return flags

    introduced by 059845b (it was previously only for aarch64-linux).

But the i686 test is not channel-blocking, so we should deal with it separately.

@vcunat
Copy link
Member

vcunat commented Feb 1, 2021

OK, let's not complicate this here. I wonder if there's even any use case for an i686 installer nowadays. I only know really about using i686 on a 64-bit OS.

@vcunat vcunat merged commit 7ca3506 into NixOS:master Feb 2, 2021
@andersk andersk deleted the installer-test-memory branch December 26, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

installer.luksroot test failing on master (sometimes)
3 participants