Fixup VM tests (#642)

This commit is contained in:
Ana Hobden 2023-09-25 08:43:11 -07:00 committed by GitHub
parent 6bee48c11e
commit da7e44e40e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
let let
nix-installer-install = '' nix-installer-install = ''
NIX_PATH=$(readlink -f nix.tar.xz) NIX_PATH=$(readlink -f nix.tar.xz)
RUST_BACKTRACE="full" ./nix-installer install --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=trace RUST_BACKTRACE="full" ./nix-installer install --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=info
''; '';
nix-installer-install-quiet = '' nix-installer-install-quiet = ''
NIX_PATH=$(readlink -f nix.tar.xz) NIX_PATH=$(readlink -f nix.tar.xz)
@ -135,7 +135,7 @@ let
install-no-start-daemon = { install-no-start-daemon = {
install = '' install = ''
NIX_PATH=$(readlink -f nix.tar.xz) NIX_PATH=$(readlink -f nix.tar.xz)
RUST_BACKTRACE="full" ./nix-installer install linux --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=trace --no-start-daemon RUST_BACKTRACE="full" ./nix-installer install linux --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=info --no-start-daemon
''; '';
check = '' check = ''
set -ex set -ex
@ -162,7 +162,7 @@ let
install-daemonless = { install-daemonless = {
install = '' install = ''
NIX_PATH=$(readlink -f nix.tar.xz) NIX_PATH=$(readlink -f nix.tar.xz)
RUST_BACKTRACE="full" ./nix-installer install linux --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=trace --init none RUST_BACKTRACE="full" ./nix-installer install linux --nix-package-url "file://$NIX_PATH" --no-confirm --logger pretty --log-directive nix_installer=info --init none
''; '';
check = '' check = ''
set -ex set -ex
@ -212,11 +212,27 @@ let
uninstall = installCases.install-default.uninstall; uninstall = installCases.install-default.uninstall;
uninstallCheck = installCases.install-default.uninstallCheck; uninstallCheck = installCases.install-default.uninstallCheck;
}; };
cure-self-linux-broken-missing-group = { cure-self-linux-broken-missing-users = {
preinstall = ''
${nix-installer-install-quiet}
sudo mv /nix/receipt.json /nix/old-receipt.json
sudo userdel nixbld1
sudo userdel nixbld3
sudo userdel nixbld16
'';
install = installCases.install-default.install;
check = installCases.install-default.check;
uninstall = installCases.install-default.uninstall;
uninstallCheck = installCases.install-default.uninstallCheck;
};
cure-self-linux-broken-missing-users-and-group = {
preinstall = '' preinstall = ''
NIX_PATH=$(readlink -f nix.tar.xz) NIX_PATH=$(readlink -f nix.tar.xz)
RUST_BACKTRACE="full" ./nix-installer install --nix-package-url "file://$NIX_PATH" --no-confirm RUST_BACKTRACE="full" ./nix-installer install --nix-package-url "file://$NIX_PATH" --no-confirm
sudo mv /nix/receipt.json /nix/old-receipt.json sudo mv /nix/receipt.json /nix/old-receipt.json
for i in {1..32}; do
sudo userdel "nixbld''${i}"
done
sudo groupdel nixbld sudo groupdel nixbld
''; '';
install = installCases.install-default.install; install = installCases.install-default.install;
@ -358,10 +374,13 @@ let
''; '';
in in
{ {
uninstall-groups-missing = { uninstall-users-and-groups-missing = {
install = installCases.install-default.install; install = installCases.install-default.install;
check = installCases.install-default.check; check = installCases.install-default.check;
preuninstall = '' preuninstall = ''
for i in $(seq 1 32); do
sudo userdel nixbld$i
done
sudo groupdel nixbld sudo groupdel nixbld
''; '';
uninstall = uninstallFailExpected; uninstall = uninstallFailExpected;
@ -376,15 +395,6 @@ let
uninstall = uninstallFailExpected; uninstall = uninstallFailExpected;
uninstallCheck = installCases.install-default.uninstallCheck; uninstallCheck = installCases.install-default.uninstallCheck;
}; };
uninstall-shell-profile-clobbered = {
install = installCases.install-default.install;
check = installCases.install-default.check;
preuninstall = ''
sudo rm -rf /etc/bashrc
'';
uninstall = uninstallFailExpected;
uninstallCheck = installCases.install-default.uninstallCheck;
};
}; };
disableSELinux = "sudo setenforce 0"; disableSELinux = "sudo setenforce 0";