From 273ecdf0703629f3e308339ecf549a8b0b2d2a4c Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Tue, 15 Dec 2009 23:26:57 +0000 Subject: [PATCH] adding nix-env -i check in booted system. It fails because nixbldN don't belong to the nixbld group Manually removing socket file. Somehow the socket is not always created when rebooting the second time (?) I have to look into that later. svn path=/nixos/trunk/; revision=18984 --- tests/test-nixos-install-from-cd/test.nix | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/test-nixos-install-from-cd/test.nix b/tests/test-nixos-install-from-cd/test.nix index 18b46b82c1b..99907438a28 100644 --- a/tests/test-nixos-install-from-cd/test.nix +++ b/tests/test-nixos-install-from-cd/test.nix @@ -67,7 +67,6 @@ rec { # TODO add nix-env -i command and verify that root can install additional # tools such as git or sshfs-fuse! - # run this test when booting both: the iso and the installed system pkgs.runCommand "nixos-installation-test" { inherit systemDerivation; } '' INFO(){ echo "INFO: " $@; } @@ -96,7 +95,10 @@ rec { # creating shell script for debugging purposes cat >> run-kvm.sh << EOF #!/bin/sh -e - # maybe swap should be used ? + + # don't ask me why I have to remove the socket.. If I don't it won't be + # reused by kvm_qemu! + rm $SOCKET_NAME || true exec qemu-system-x86_64 -m 512 \ -no-kvm-irqchip \ -net nic,model=virtio -net user -smb /nix \ @@ -206,6 +208,26 @@ rec { INFO "booting installed system" RUN_KVM -boot c waitForSSHD + + + INFO "verifying that nix-env -i works" + + SSH_STDIN_E << EOF + + cat >> test.nix << EOF_TEST + let pkgs = import /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix {}; + in pkgs.stdenv.mkDerivation { + name = "test"; + phases = "create_out"; + create_out = "mkdir -p $out/ok"; + } + EOF_TEST + + set -x + nix-env -i -f test.nix + [ -e ~/.nix-profile/ok ] + EOF + SHUTDOWN_VM echo "$(date) success" > $out