File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) 2023, see AUTHORS. Licensed under MIT License, see LICENSE.
2+
3+ load lib
4+
5+ @test ' successfully loads a config with _class="nixOnDroid"' {
6+ # set up / build / activate the configuration
7+ echo ' { config.system.stateVersion = "24.05"; _class = "nixOnDroid"; }' > ~ /.config/nixpkgs/nix-on-droid.nix
8+ _sed -e " s|<<FLAKE_URL>>|$FLAKE_URL |g" -e " s|<<SYSTEM>>|$( detect_system) |g" \
9+ " $ON_DEVICE_TESTS_DIR /config-flake.nix" \
10+ > ~ /.config/nixpkgs/flake.nix
11+
12+ nix-on-droid switch --flake ~ /.config/nixpkgs#device
13+ }
14+
15+ @test ' fails to load a config with _class="nixos"' {
16+ # set up / build / activate the configuration
17+ echo ' { config.system.stateVersion = "24.05"; _class = "nixos"; }' > ~ /.config/nixpkgs/nix-on-droid.nix
18+ _sed -e " s|<<FLAKE_URL>>|$FLAKE_URL |g" -e " s|<<SYSTEM>>|$( detect_system) |g" \
19+ " $ON_DEVICE_TESTS_DIR /config-flake.nix" \
20+ > ~ /.config/nixpkgs/flake.nix
21+
22+ # check that networking.hosts can't map localhost
23+ run nix-on-droid switch --flake ~ /.config/nixpkgs#device
24+ [ " $status " -eq 1 ]
25+ }
You can’t perform that action at this time.
0 commit comments