Remove test which assumes that passing in a arbitrary user to dolt sql is valid

Use the common bats setup in import-mysqldump.bats
This commit is contained in:
Neil Macneale IV
2023-06-16 14:01:35 -07:00
parent 0a74312178
commit 6538cbd2ed
3 changed files with 1 additions and 49 deletions

View File

@@ -2,11 +2,7 @@
load $BATS_TEST_DIRNAME/helper/common.bash
setup() {
REPO_NAME="dolt_repo_$$"
mkdir $REPO_NAME
cd $REPO_NAME
dolt init
setup_common
}
teardown() {

View File

@@ -21,28 +21,6 @@ teardown() {
teardown_common
}
@test "sql-shell: --user option changes superuser" {
# remove config
rm -rf .doltcfg
# default is root@localhost
run dolt sql <<< "select user, host from mysql.user"
[ "$status" -eq 0 ]
[[ "$output" =~ "root" ]] || false
! [[ "$output" =~ "dolt" ]] || false
[[ "$output" =~ "localhost" ]] || false
# make it dolt@localhost
run dolt --user=dolt sql <<< "select user, host from mysql.user"
[ "$status" -eq 0 ]
! [[ "$output" =~ "root" ]] || false
[[ "$output" =~ "dolt" ]] || false
[[ "$output" =~ "localhost" ]] || false
# remove config
rm -rf .doltcfg
}
@test "sql-shell: use user without privileges, and no superuser created" {
rm -rf .doltcfg

View File

@@ -39,28 +39,6 @@ teardown() {
teardown_common
}
@test "sql: --user option changes superuser" {
# remove config
rm -rf .doltcfg
# default is root@localhost
run dolt sql -q "select user, host from mysql.user"
[ "$status" -eq 0 ]
[[ "$output" =~ "root" ]] || false
! [[ "$output" =~ "dolt" ]] || false
[[ "$output" =~ "localhost" ]] || false
# make it dolt@localhost
run dolt --user=dolt sql -q "select user, host from mysql.user"
[ "$status" -eq 0 ]
! [[ "$output" =~ "root" ]] || false
[[ "$output" =~ "dolt" ]] || false
[[ "$output" =~ "localhost" ]] || false
# remove config
rm -rf .doltcfg
}
@test "sql: --user don't create superuser if using an existing user" {
rm -rf .doltcfg