[autotest] split the db setup script from setup_dev_autotest.sh

For some situations, we only want to clean up the database rather than
setting up the whole autotest on the servers. For example, when we
remove shards from master, we just need to swipe the database to clean
all the jobs and hosts history. A lot of the functions in
setup_dev_autotest.sh are unnecessary for this purpose.

BUG=None
TEST=Test on a testing master instance. Test the following cmds:
     './setup_dev_autotest.sh -p ${PWD} -a ${AUTOTEST_DIR} -d -m -n -v'
     './setup_db.sh -p ${PWD} -a'
     './setup_db.sh -p ${PWD} -a ${AUTOTEST_DIR}'
     './setup_db.sh -p ${PWD} -a ${AUTOTEST_DIR} -c'
     './setup_db.sh -p ${PWD} -a ${AUTOTEST_DIR} -c'

Change-Id: I736c68c4bc77f22cfd1c815980e546c9cf136f71
Reviewed-on: https://chromium-review.googlesource.com/328532
Commit-Ready: Shuqian Zhao <shuqianz@chromium.org>
Tested-by: Shuqian Zhao <shuqianz@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
2 files changed