add bats test for dolt profile global config file 0600 lock

This commit is contained in:
Stephanie You
2023-08-01 15:56:50 -07:00
parent 21374b316d
commit a3bd8a0a24

View File

@@ -183,6 +183,14 @@ teardown() {
[[ "$output" =~ "Only one profile name can be specified" ]] || false
}
@test "profile: dolt profile add locks global config with 0600" {
run dolt profile add --use-db altDB altTest
[ "$status" -eq 0 ] || false
run stat "$BATS_TMPDIR/config-$$/.dolt/config_global.json"
[[ "$output" =~ "-rw-------" ]] || false
}
@test "profile: dolt profile remove removes a profile" {
dolt profile add --use-db altDB altTest
run dolt profile
@@ -242,6 +250,15 @@ teardown() {
[[ "$output" =~ "Only one profile name can be specified" ]] || false
}
@test "profile: dolt profile remove locks global config with 0600" {
dolt profile add --use-db altDB altTest
run dolt profile remove altTest
[ "$status" -eq 0 ] || false
run stat "$BATS_TMPDIR/config-$$/.dolt/config_global.json"
[[ "$output" =~ "-rw-------" ]] || false
}
@test "profile: dolt profile lists all profiles" {
dolt profile add --use-db altDB altTest
dolt profile add --use-db defaultDB -u "steph" --password "pass" defaultTest