Add shell based test harness
This allows you to simulate one or more simultaneously running mgmt processes. It should be easy to use by following the test cases provided.
This commit is contained in:
67
test/shell/t3.sh
Executable file
67
test/shell/t3.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
. etcd.sh # start etcd as job # 1
|
||||
|
||||
# setup
|
||||
mkdir -p "${MGMT_TMPDIR}"mgmt{A..C}
|
||||
|
||||
# run till completion
|
||||
timeout --kill-after=15s 10s ./mgmt run --file t3-a.yaml --converged-timeout=5 --no-watch &
|
||||
timeout --kill-after=15s 10s ./mgmt run --file t3-b.yaml --converged-timeout=5 --no-watch &
|
||||
timeout --kill-after=15s 10s ./mgmt run --file t3-c.yaml --converged-timeout=5 --no-watch &
|
||||
|
||||
. wait.sh # wait for everything except etcd
|
||||
|
||||
# A: collected
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f3b
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f3c
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f4b
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f4c
|
||||
|
||||
# A: local
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f1a
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f2a
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f3a
|
||||
test -e "${MGMT_TMPDIR}"mgmtA/f4a
|
||||
|
||||
# A: nope!
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtA/f1b
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtA/f2b
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtA/f1c
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtA/f2c
|
||||
|
||||
# B: collected
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f3a
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f3c
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f4a
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f4c
|
||||
|
||||
# B: local
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f1b
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f2b
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f3b
|
||||
test -e "${MGMT_TMPDIR}"mgmtB/f4b
|
||||
|
||||
# B: nope!
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtB/f1a
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtB/f2a
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtB/f1c
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtB/f2c
|
||||
|
||||
# C: collected
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f3a
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f3b
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f4a
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f4b
|
||||
|
||||
# C: local
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f1c
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f2c
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f3c
|
||||
test -e "${MGMT_TMPDIR}"mgmtC/f4c
|
||||
|
||||
# C: nope!
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f1a
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f2a
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f1b
|
||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f2b
|
||||
Reference in New Issue
Block a user