Open a bash session to the agent and add the following scripts to the /tmp
folder
hoop connect bash
cat - > /tmp/mongo1 <<'EOF'
#!/bin/bash
set -eo pipefail
MONGO_BIN=/usr/bin/mongo
$MONGO_BIN $@
EOF
cat - > /tmp/mongo2 <<'EOF'
#!/bin/bash
set -eo pipefail
/usr/bin/mongo $@
EOF
cat - > /tmp/mongo3 <<'EOF'
#!/bin/bash
/usr/bin/mongo $@
EOF
cat - > /tmp/mongo4 <<'EOF'
#!/bin/bash
/usr/bin/mongo "$@"
EOF
cat - > /tmp/mongo5 <<'EOF'
#!/bin/bash
MONGO_BIN=/usr/bin/mongo
$MONGO_BIN "$@"
EOF
chmod +x /tmp/mongo*
hoop admin create conn mongo1-test -a default --type database/mongodb \
-e CONNECTION_STRING="" \
-- /tmp/mongo1 --quiet '$CONNECTION_STRING'
hoop admin create conn mongo2-test -a default --type database/mongodb \
-e CONNECTION_STRING="" \
-- /tmp/mongo2 --quiet '$CONNECTION_STRING'
hoop admin create conn mongo3-test -a default --type database/mongodb \
-e CONNECTION_STRING="" \
-- /tmp/mongo3 --quiet '$CONNECTION_STRING'
hoop admin create conn mongo4-test -a default --type database/mongodb \
-e CONNECTION_STRING="" \
-- /tmp/mongo4 --quiet '$CONNECTION_STRING'
hoop admin create conn mongo5-test -a default --type database/mongodb \
-e CONNECTION_STRING="" \
-- /tmp/mongo5 --quiet '$CONNECTION_STRING'
- Test listing the tables in the editor for each connection and see which one fails
hoop admin delete conn mongo1-test
hoop admin delete conn mongo2-test
hoop admin delete conn mongo3-test
hoop admin delete conn mongo4-test
hoop admin delete conn mongo5-test
hoop connect bash
rm -f /tmp/mongo*