Skip to content

Commit 6293167

Browse files
committed
Run acls.sh test properly
1 parent 1102fdd commit 6293167

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

tests/acls.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
source common.sh
22

3+
USER=$(whoami)
4+
5+
setfacl -m "u:$USER:r" example || skipTest "ACLs not supported"
6+
37
# Adds the "dummy" file to the nix store and check that we can access it
48
EXAMPLE_PATH=$(nix store add-path dummy)
59
nix store access info "$EXAMPLE_PATH" --json | grep '"protected":false'
@@ -12,8 +16,6 @@ nix store access protect "$EXAMPLE_PATH"
1216
nix store access info "$EXAMPLE_PATH" --json | grep '"protected":true'
1317
nix store access info "$EXAMPLE_PATH" --json | grep '"users":\[\]'
1418

15-
USER=$(whoami)
16-
1719
# Grant permission and check that we can access the file
1820
nix store access grant "$EXAMPLE_PATH" --user "$USER"
1921
cat "$EXAMPLE_PATH"

tests/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cat > "$NIX_CONF_DIR"/nix.conf <<EOF
2020
build-users-group =
2121
keep-derivations = false
2222
sandbox = false
23-
experimental-features = nix-command flakes
23+
experimental-features = nix-command flakes acls
2424
gc-reserved-space = 0
2525
substituters =
2626
flake-registry = $TEST_ROOT/registry.json

tests/local.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ nix_tests = \
137137
path-from-hash-part.sh \
138138
test-libstoreconsumer.sh \
139139
toString-path.sh \
140-
read-only-store.sh
140+
read-only-store.sh \
141+
acls.sh
141142

142143
acls_test = \
143144
acls.sh \

tests/nixos/acls.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ let
3535
permissions = {
3636
protected = true;
3737
users = ["root" "test"];
38+
groups = ["root"];
3839
};
3940
};
4041
buildCommand = "echo Example > $out; cat $exampleSource >> $out";
@@ -60,6 +61,7 @@ let
6061
permissions = {
6162
protected = true;
6263
users = ["root" "test"];
64+
groups = ["root"];
6365
};
6466
};
6567
buildCommand = "echo Example > $out; cat $exampleSource >> $out";

0 commit comments

Comments
 (0)