Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2pe1S5Y4i2a2Trz/nTDPfD97MZgWJvKGunzi9lqQH+I=; b=V4Itb2Mt11Ql1e0kcFo7qihukm4oiU1aKWbYBC8MdJo8ZZgdsmiRJGPa8B5ao/6Hbr fbW8+Ufkje+w/ZlimPLYJDfWWtH8UegXB1VRIT222mRqcx53FTDu90ixN09+OECiK925 yfqH8IOTVoND1gSe2wo7bCpVTq4BFahb/JLzcx4GOePPbBof0qijO+PgtMCRpkZp6GcV 5ORnzz/roZE58rttlkHYHAanVWGn5DCRRvfUCEulwqsWBTePen/vKP0cjgBPGDRzbkxf q7kPGtutPnOj1vStREpKZ/DPhLGI7oTDBaeriDYjhntVTmqHoaAKkWcH1evr4bUUu1UE xW/Q== From: Guilherme Campos Camargo Date: Wed, 2 May 2018 11:20:52 -0300 Message-Id: <20180502142052.29544-9-guicc@profusion.mobi> In-Reply-To: <20180502142052.29544-1-guicc@profusion.mobi> References: <20180502142052.29544-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 8/8] Log test results with the REPORT log level and print descriptions List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Log test results with the REPORT log level and print descriptions. In this patch we also update fuego_test.sh to allow parsing the new test results format. Signed-off-by: Guilherme Campos Camargo --- .../tests/Functional.fuego_release_test/fuego_test.sh | 10 +++------- engine/tests/Functional.fuego_release_test/test_run.py | 7 ++++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/engine/tests/Functional.fuego_release_test/fuego_test.sh b/engine/tests/Functional.fuego_release_test/fuego_test.sh index 05b4b7b..242fa70 100755 --- a/engine/tests/Functional.fuego_release_test/fuego_test.sh +++ b/engine/tests/Functional.fuego_release_test/fuego_test.sh @@ -21,14 +21,10 @@ function test_build { } function test_run { - sudo -n "${TEST_HOME}/test_run.py" "${fuego_release_dir}/fuego" -d ${TEST_HOME} -o . - if [ "${?}" = 0 ]; then - report "echo ok 1 fuego release test" - else - report "echo not ok 1 fuego release test" - fi + report "sudo -n ${TEST_HOME}/test_run.py ${fuego_release_dir}/fuego -d ${TEST_HOME} -o ." } function test_processing { - log_compare "$TESTDIR" "1" "^ok" "p" + log_compare "$TESTDIR" "1" "ok" "p" + log_compare "$TESTDIR" "0" "not ok" "n" } diff --git a/engine/tests/Functional.fuego_release_test/test_run.py b/engine/tests/Functional.fuego_release_test/test_run.py index 52fbae3..d3c65f6 100755 --- a/engine/tests/Functional.fuego_release_test/test_run.py +++ b/engine/tests/Functional.fuego_release_test/test_run.py @@ -761,14 +761,15 @@ def main(): } tests_ok = True - for cmd in COMMANDS_TO_TEST: + for cmd_id, cmd in enumerate(COMMANDS_TO_TEST, 1): for base_class, ctx in ctx_mapper.items(): if isinstance(cmd, base_class): + LOGGER.report("run %s %s", cmd_id, cmd.description) if not cmd.exec(ctx): tests_ok = False - LOGGER.error(" FAIL") + LOGGER.report("not ok %s", cmd_id) break - LOGGER.info(" PASS") + LOGGER.report("ok %s", cmd_id) if tests_ok: LOGGER.info("All tests finished with SUCCESS") -- 2.17.0