[autotest] Allow remote access for shard DB
Sentinel service needs to access shards' DB remotely.
Change the semantics of -m option of setup_dev_autotest.sh.
BUG=chromium:497259
TEST=
Change-Id: I273e264b0e605c27ba17fc9c11aeb8d1ad9ac05b
Reviewed-on: https://chromium-review.googlesource.com/296070
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
diff --git a/site_utils/setup_dev_autotest.sh b/site_utils/setup_dev_autotest.sh
index 41aa91c..709791b 100755
--- a/site_utils/setup_dev_autotest.sh
+++ b/site_utils/setup_dev_autotest.sh
@@ -15,7 +15,7 @@
-v Show info logging from build_externals.py and compile_gwt_clients.py \n\
-n Non-interactive mode, doesn't ask for any user input.
Requires -p and -a to be set.\n\
- -m Master node."
+ -m Allow remote access for database."
function get_y_or_n_interactive {
local ret
@@ -43,9 +43,9 @@
PASSWD=
verbose="FALSE"
noninteractive="FALSE"
-master="FALSE"
+remotedb="FALSE"
while getopts ":p:a:vnmh" opt; do
- case $opt in
+ case ${opt} in
a)
AUTOTEST_DIR=$OPTARG
;;
@@ -59,7 +59,7 @@
noninteractive="TRUE"
;;
m)
- master="TRUE"
+ remotedb="TRUE"
;;
h)
echo -e "${HELP}" >&2
@@ -217,8 +217,7 @@
local sql_priv="GRANT ALL PRIVILEGES ON $db_name.* TO \
'chromeosqa-admin'@'localhost' IDENTIFIED BY '${PASSWD}';"
- # Master DB needs to enable connection from shard nodes.
- if [ "${master}" = "TRUE" ]; then
+ if [ "${remotedb}" = "TRUE" ]; then
sql_priv="${sql_priv} GRANT ALL PRIVILEGES ON $db_name.* TO \
'chromeosqa-admin'@'%' IDENTIFIED BY '${PASSWD}';"
fi