From 619e53ac7240c237c60eb9b50f816b7ea1c392f3 Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Sun, 12 Dec 2021 17:18:07 +0100 Subject: [PATCH] tests: simplify clean up logic for ~/.config/nixpkgs --- tests/on-device/config-flake-h-m.bats | 1 - tests/on-device/config-flake.bats | 1 - tests/on-device/lib.bash | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/on-device/config-flake-h-m.bats b/tests/on-device/config-flake-h-m.bats index 92841cb..8f4fd19 100644 --- a/tests/on-device/config-flake-h-m.bats +++ b/tests/on-device/config-flake-h-m.bats @@ -24,7 +24,6 @@ load lib assert_no_command vi # check that reverting works too - rm -f ~/.config/nix/nix.conf ~/.config/nixpkgs/flake.nix switch_to_default_config assert_command vi assert_no_command dash zsh diff --git a/tests/on-device/config-flake.bats b/tests/on-device/config-flake.bats index 5f8e6b8..8664e2c 100644 --- a/tests/on-device/config-flake.bats +++ b/tests/on-device/config-flake.bats @@ -28,7 +28,6 @@ load lib assert_no_command vi # check that reverting works too - rm -f ~/.config/nix/nix.conf ~/.config/nixpkgs/flake.nix switch_to_default_config assert_command vi assert_no_command unzip diff --git a/tests/on-device/lib.bash b/tests/on-device/lib.bash index 8057249..3ae817f 100644 --- a/tests/on-device/lib.bash +++ b/tests/on-device/lib.bash @@ -26,6 +26,7 @@ setup() { # restore to pre-testing generation before the start of each test $DEFAULT_ACTIVATE_SCRIPT + rm -rf ~/.config/nixpkgs/* # build and activate the version of nix-on-droid that is subject to test switch_to_default_config @@ -45,8 +46,6 @@ assert_no_command() { } 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" \ > ~/.config/nixpkgs/nix-on-droid.nix nix-on-droid switch