tests: simplify clean up logic for ~/.config/nixpkgs

This commit is contained in:
Tobias Happ 2021-12-12 17:18:07 +01:00
parent 43b94dee09
commit b377c6c902
3 changed files with 1 additions and 4 deletions

View file

@ -24,7 +24,6 @@ load lib
assert_no_command vi assert_no_command vi
# check that reverting works too # check that reverting works too
rm -f ~/.config/nix/nix.conf ~/.config/nixpkgs/flake.nix
switch_to_default_config switch_to_default_config
assert_command vi assert_command vi
assert_no_command dash zsh assert_no_command dash zsh

View file

@ -28,7 +28,6 @@ load lib
assert_no_command vi assert_no_command vi
# check that reverting works too # check that reverting works too
rm -f ~/.config/nix/nix.conf ~/.config/nixpkgs/flake.nix
switch_to_default_config switch_to_default_config
assert_command vi assert_command vi
assert_no_command unzip assert_no_command unzip

View file

@ -26,6 +26,7 @@ setup() {
# restore to pre-testing generation before the start of each test # restore to pre-testing generation before the start of each test
$DEFAULT_ACTIVATE_SCRIPT $DEFAULT_ACTIVATE_SCRIPT
rm -rf ~/.config/nixpkgs/*
# build and activate the version of nix-on-droid that is subject to test # build and activate the version of nix-on-droid that is subject to test
switch_to_default_config switch_to_default_config
@ -45,8 +46,6 @@ assert_no_command() {
} }
switch_to_default_config() { switch_to_default_config() {
rm -rf ~/.config/nix ~/.config/nixpkgs
mkdir -p ~/.config/nix ~/.config/nixpkgs
cat "$CHANNEL_DIR/modules/environment/login/nix-on-droid.nix.default" \ cat "$CHANNEL_DIR/modules/environment/login/nix-on-droid.nix.default" \
> ~/.config/nixpkgs/nix-on-droid.nix > ~/.config/nixpkgs/nix-on-droid.nix
nix-on-droid switch nix-on-droid switch