mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-05 00:50:17 -06:00
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:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user