From a3bd8a0a2427c2b68993af24844f2cb701ba60cf Mon Sep 17 00:00:00 2001 From: Stephanie You Date: Tue, 1 Aug 2023 15:56:50 -0700 Subject: [PATCH] add bats test for dolt profile global config file 0600 lock --- integration-tests/bats/profile.bats | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/integration-tests/bats/profile.bats b/integration-tests/bats/profile.bats index 92af55e5be..83d8c733e3 100755 --- a/integration-tests/bats/profile.bats +++ b/integration-tests/bats/profile.bats @@ -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