Enable daemon installation test on Fedora

This commit is contained in:
Eelco Dolstra 2022-09-14 18:53:30 +02:00
parent 0a8e666dd6
commit 906c947ee8
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -7,8 +7,6 @@ let
installScripts = { installScripts = {
install-default = { install-default = {
script = '' script = ''
set -eux
tar -xf ./nix.tar.xz tar -xf ./nix.tar.xz
mv ./nix-* nix mv ./nix-* nix
./nix/install --no-channel-add ./nix/install --no-channel-add
@ -17,8 +15,6 @@ let
install-force-no-daemon = { install-force-no-daemon = {
script = '' script = ''
set -eux
tar -xf ./nix.tar.xz tar -xf ./nix.tar.xz
mv ./nix-* nix mv ./nix-* nix
./nix/install --no-daemon ./nix/install --no-daemon
@ -27,15 +23,15 @@ let
install-force-daemon = { install-force-daemon = {
script = '' script = ''
set -eux
tar -xf ./nix.tar.xz tar -xf ./nix.tar.xz
mv ./nix-* nix mv ./nix-* nix
./nix/install --daemon ./nix/install --daemon --no-channel-add
''; '';
}; };
}; };
disableSELinux = "sudo setenforce 0";
images = { images = {
"ubuntu-14-04" = { "ubuntu-14-04" = {
@ -65,7 +61,6 @@ let
system = "x86_64-linux"; system = "x86_64-linux";
}; };
"fedora-36" = { "fedora-36" = {
image = import <nix/fetchurl.nix> { image = import <nix/fetchurl.nix> {
url = https://app.vagrantup.com/generic/boxes/fedora36/versions/4.1.12/providers/libvirt.box; url = https://app.vagrantup.com/generic/boxes/fedora36/versions/4.1.12/providers/libvirt.box;
@ -73,6 +68,7 @@ let
}; };
rootDisk = "box.img"; rootDisk = "box.img";
system = "x86_64-linux"; system = "x86_64-linux";
postBoot = disableSELinux;
}; };
}; };
@ -84,6 +80,7 @@ let
"installer-test-${imageName}-${testName}" "installer-test-${imageName}-${testName}"
{ buildInputs = [ qemu_kvm openssh ]; { buildInputs = [ qemu_kvm openssh ];
image = image.image; image = image.image;
postBoot = image.postBoot or "";
installScript = installScripts.${testName}.script; installScript = installScripts.${testName}.script;
binaryTarball = binaryTarballs.${system}; binaryTarball = binaryTarballs.${system};
} }
@ -125,15 +122,25 @@ let
sleep 1 sleep 1
done done
if [[ -n $postBoot ]]; then
echo "Running post-boot commands..."
$ssh "set -ex; $postBoot"
fi
echo "Copying installer..." echo "Copying installer..."
scp -P 20022 $ssh_opts $binaryTarball/nix-*.tar.xz vagrant@localhost:nix.tar.xz scp -P 20022 $ssh_opts $binaryTarball/nix-*.tar.xz vagrant@localhost:nix.tar.xz
echo "Running installer..." echo "Running installer..."
$ssh "$installScript" $ssh "set -eux; $installScript"
echo "Testing Nix installation..." echo "Testing Nix installation..."
# FIXME: should update ~/.bashrc. # FIXME: should update ~/.bashrc.
$ssh "source ~/.bash_profile || source ~/.bash_login || source ~/.profile || true; nix-env --version" $ssh "
set -ex
source ~/.bash_profile || source ~/.bash_login || source ~/.profile || true
nix-env --version
nix --extra-experimental-features nix-command store ping
"
echo "Done!" echo "Done!"
touch $out touch $out
@ -146,4 +153,5 @@ in
#ubuntu-16-04.install-default = makeTest "ubuntu-16-04" "install-default"; #ubuntu-16-04.install-default = makeTest "ubuntu-16-04" "install-default";
#ubuntu-22-10.install-default = makeTest "ubuntu-22-10" "install-default"; #ubuntu-22-10.install-default = makeTest "ubuntu-22-10" "install-default";
fedora-36.install-default = makeTest "fedora-36" "install-default"; fedora-36.install-default = makeTest "fedora-36" "install-default";
fedora-36.install-force-daemon = makeTest "fedora-36" "install-force-daemon";
} }