@@ -11,6 +11,10 @@ source dev-container-features-test-lib
1111# check that the command is available
1212check " help" bash -c " edgedb --help | grep 'Usage'"
1313
14+ # make sure edgedb directories match up with our expectations
15+ check " edgedb cli data dir" bash -c " test \" $( edgedb info --get data-dir) \" = $HOME /.local/share/edgedb/data/"
16+ check " edgedb cli config dir" bash -c " test \" $( edgedb info --get config-dir) \" = $HOME /.config/edgedb/"
17+
1418# check that data directories exist
1519check " ~/.local/share/edgedb exists" bash -c " ls -la ~/.local/share | grep 'edgedb'"
1620check " /dc/edgedb-cli/data exists" bash -c " ls -la /dc/edgedb-cli | grep 'data'"
@@ -21,13 +25,14 @@ check "/dc/edgedb-cli exists" bash -c "ls -la /dc/edgedb-cli | grep 'config'"
2125
2226# check that the folders are owned by the user
2327# https://askubuntu.com/a/175060
24- echo " Checking ownership of ~/.local/share/edgedb/data and /dc/edgedb-cli/data (ensure it is owned by $USER )"
28+ # $USER is empty when running as root, so we use $(whoami)
29+ echo " Checking ownership of ~/.local/share/edgedb/data and /dc/edgedb-cli/data (ensure it is owned by $( whoami) )"
2530
26- check " ~/.local/share/edgedb owned by user" bash -c " test \" $( stat -c " %U" ~ /.local/share/edgedb) \" = $USER "
27- check " /dc/edgedb-cli/data owned by user" bash -c " test \" $( stat -c " %U" /dc/edgedb-cli/data) \" = $USER "
31+ check " ~/.local/share/edgedb owned by user" bash -c " test \" $( stat -c " %U" ~ /.local/share/edgedb) \" = $( whoami ) "
32+ check " /dc/edgedb-cli/data owned by user" bash -c " test \" $( stat -c " %U" /dc/edgedb-cli/data) \" = $( whoami ) "
2833
29- check " ~/.config/edgedb owned by user" bash -c " test \" $( stat -c " %U" ~ /.config/edgedb) \" = $USER "
30- check " /dc/edgedb-cli/config owned by user" bash -c " test \" $( stat -c " %U" /dc/edgedb-cli/config) \" = $USER "
34+ check " ~/.config/edgedb owned by user" bash -c " test \" $( stat -c " %U" ~ /.config/edgedb) \" = $( whoami ) "
35+ check " /dc/edgedb-cli/config owned by user" bash -c " test \" $( stat -c " %U" /dc/edgedb-cli/config) \" = $( whoami ) "
3136
3237# Report result
3338reportResults
0 commit comments