From 333072ffd967ea35248a9ff056e2eb4d26d11fbb Mon Sep 17 00:00:00 2001 From: Costas Papastathis Date: Wed, 25 Sep 2024 14:21:06 +0300 Subject: [PATCH] adding missing library --- test/test-lib-nodejs.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/test-lib-nodejs.sh b/test/test-lib-nodejs.sh index d689c468..4e9756bf 100644 --- a/test/test-lib-nodejs.sh +++ b/test/test-lib-nodejs.sh @@ -356,6 +356,47 @@ test_incremental_build() { } +test_node_cmd() { + local app=$1 + local node_env=$2 + local init_wrapper=$3 + local node_cmd=$4 + + run_test_application_with_quoted_args $app "-e NODE_ENV=$node_env -e INIT_WRAPPER=$init_wrapper -e NODE_CMD=$node_cmd" + logs=$(container_logs) + wait_for_cid + + test_connection + ct_check_testcase_result $? + + logs=$(container_logs) + echo ${logs} | grep -q DEBUG_PORT=5858 + ct_check_testcase_result $? + echo ${logs} | grep -q NODE_ENV=$node_env + ct_check_testcase_result $? + echo ${logs} | grep -q INIT_WRAPPER=$init_wrapper + ct_check_testcase_result $? + echo ${logs} | grep -q NODE_CMD="$node_cmd" + ct_check_testcase_result $? + + kill_test_application +} + +function test_scl_variables_in_dockerfile() { + if [ "$OS" == "rhel7" ] || [ "$OS" == "centos7" ]; then + echo "Testing npm availability in Dockerfile" + ct_binary_found_from_df npm + ct_check_testcase_result $? + + info "Testing variable presence during \`docker exec\`" + ct_check_exec_env_vars + ct_check_testcase_result $? + + info "Checking if all scl variables are defined in Dockerfile" + ct_check_scl_enable_vars + ct_check_testcase_result $? + fi +} # test express webapp run_s2i_build_express_webapp() {