Create and enable funcional testing
The funcional testing will include, per case, input files and output files, plus a simple bash script which makes sure the output stays as it should, and otherwise shows a diff and fails the case. Change-Id: I4c5f1143188f49c6a1448ca8918ab8b30710b865
This commit is contained in:
parent
384b6b5a1e
commit
99522bf3e4
|
@ -16,4 +16,5 @@
|
|||
templates:
|
||||
- openstack-python-jobs
|
||||
- openstack-python35-jobs
|
||||
- openstack-python36-jobs
|
||||
- openstack-python36-jobs
|
||||
# WIP: add openstack-functional-jobs?? whats the name
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
2015-10-29 10:51:23.829 3667 INFO neutron.openstack.common.service [req-7a01c151-b6ff-4dd9-9fd2-9710a83bab57 None] Caught SIGTERM, exiting
|
||||
2015-10-29 10:51:28.862 27650 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-29 10:51:28.865 27650 INFO neutron.common.config [-] /usr/bin/neutron-l3-agent version 2014.2.3-19.el7ost
|
||||
2015-10-29 10:51:28.916 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.018 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.046 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.159 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.601 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.692 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.754 27650 INFO neutron.agent.l3_agent [-] L3 agent started
|
|
@ -0,0 +1,5 @@
|
|||
2015-10-20 09:23:45.717 5411 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-20 09:23:45.719 5411 INFO neutron.common.config [-] /usr/bin/neutron-metadata-agent version 2014.2.3-19.el7ost
|
||||
2015-10-20 09:23:45.801 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Starting 4 workers
|
||||
2015-10-20 09:23:45.808 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5498
|
||||
2015-10-20 09:23:45.822 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5499
|
|
@ -0,0 +1,15 @@
|
|||
2015-10-20 09:23:45.717 [META] 5411 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-20 09:23:45.719 [META] 5411 INFO neutron.common.config [-] /usr/bin/neutron-metadata-agent version 2014.2.3-19.el7ost
|
||||
2015-10-20 09:23:45.801 [META] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Starting 4 workers
|
||||
2015-10-20 09:23:45.808 [META] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5498
|
||||
2015-10-20 09:23:45.822 [META] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5499
|
||||
2015-10-29 10:51:23.829 [L3] 3667 INFO neutron.openstack.common.service [req-7a01c151-b6ff-4dd9-9fd2-9710a83bab57 None] Caught SIGTERM, exiting
|
||||
2015-10-29 10:51:28.862 [L3] 27650 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-29 10:51:28.865 [L3] 27650 INFO neutron.common.config [-] /usr/bin/neutron-l3-agent version 2014.2.3-19.el7ost
|
||||
2015-10-29 10:51:28.916 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.018 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.046 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.159 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.601 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.692 [L3] 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.754 [L3] 27650 INFO neutron.agent.l3_agent [-] L3 agent started
|
|
@ -0,0 +1,15 @@
|
|||
2015-10-20 09:23:45.717 [oslogmerger/tests/functional/data/01-simple/in/metadata-agent.log] 5411 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-20 09:23:45.719 [oslogmerger/tests/functional/data/01-simple/in/metadata-agent.log] 5411 INFO neutron.common.config [-] /usr/bin/neutron-metadata-agent version 2014.2.3-19.el7ost
|
||||
2015-10-20 09:23:45.801 [oslogmerger/tests/functional/data/01-simple/in/metadata-agent.log] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Starting 4 workers
|
||||
2015-10-20 09:23:45.808 [oslogmerger/tests/functional/data/01-simple/in/metadata-agent.log] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5498
|
||||
2015-10-20 09:23:45.822 [oslogmerger/tests/functional/data/01-simple/in/metadata-agent.log] 5411 INFO neutron.openstack.common.service [req-7522c96c-2b7c-4f99-9d14-fde98e04da25 None] Started child 5499
|
||||
2015-10-29 10:51:23.829 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 3667 INFO neutron.openstack.common.service [req-7a01c151-b6ff-4dd9-9fd2-9710a83bab57 None] Caught SIGTERM, exiting
|
||||
2015-10-29 10:51:28.862 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO neutron.common.config [-] Logging enabled!
|
||||
2015-10-29 10:51:28.865 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO neutron.common.config [-] /usr/bin/neutron-l3-agent version 2014.2.3-19.el7ost
|
||||
2015-10-29 10:51:28.916 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.018 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.046 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.159 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [req-6afee29e-f17a-4168-8f7b-fcaea6609e4e ] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.601 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.692 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 10.12.27.29:5672
|
||||
2015-10-29 10:51:29.754 [oslogmerger/tests/functional/data/01-simple/in/l3-agent.log] 27650 INFO neutron.agent.l3_agent [-] L3 agent started
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
|
||||
DATA=oslogmerger/tests/functional/data
|
||||
|
||||
fail_func() {
|
||||
echo FAILED test case $1 with output file $2
|
||||
rm -rf $3
|
||||
exit 1
|
||||
}
|
||||
|
||||
run_test() {
|
||||
|
||||
TEST=$1
|
||||
OUT_FILE=$2
|
||||
IN=$DATA/$TEST/in
|
||||
OUT=$DATA/$TEST/out
|
||||
TMP=$(mktemp -d)
|
||||
|
||||
shift 2
|
||||
|
||||
# replace TDATA with the "in" directory for the test
|
||||
PARAMS=$(echo $* | sed --expression=s%TDATA%${IN}%g)
|
||||
|
||||
# run os-log-merger capturing the output, then conpare to what we expected
|
||||
os-log-merger $PARAMS >$TMP/out.log
|
||||
|
||||
diff -u $OUT/$OUT_FILE $TMP/out.log || fail_func $TEST $OUT_FILE $TMP
|
||||
|
||||
echo PASSED test case $TEST / $OUT_FILE
|
||||
rm -rf $TMP
|
||||
|
||||
}
|
||||
|
||||
run_test 01-simple no-alias.log TDATA/metadata-agent.log TDATA/l3-agent.log
|
||||
run_test 01-simple alias.log TDATA/metadata-agent.log:META TDATA/l3-agent.log:L3
|
||||
|
||||
|
||||
|
||||
|
11
tox.ini
11
tox.ini
|
@ -37,6 +37,17 @@ whitelist_externals =
|
|||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:functional]
|
||||
basepython = python2.7
|
||||
commands=
|
||||
sh ./oslogmerger/tests/functional/functional.sh
|
||||
whitelist_externals =
|
||||
sh
|
||||
bash
|
||||
|
||||
[testenv:functional-python35]
|
||||
basepython = python3.5
|
||||
|
||||
[flake8]
|
||||
# E125 continuation line does not distinguish itself from next logical line
|
||||
# E126 continuation line over-indented for hanging indent
|
||||
|
|
Loading…
Reference in New Issue