diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases')
17 files changed, 597 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/case.py new file mode 100644 index 000000000..b8d2c38b8 --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/01-install/case.py @@ -0,0 +1,94 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #uninstall inexistent App1 + ret = uninstall_app("App1") + if (ret != 160): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps([]) + if (ret == False): + return False, '' + + #install App1 + ret = install_app("App1", "01_install.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #install App2 + ret = install_app("App2", "01_install.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1","App2"]) + if (ret == False): + return False, '' + + #uninstall App2 + ret = uninstall_app("App2") + if (ret != 66): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/case.py new file mode 100644 index 000000000..e2192d5fa --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/02-request/case.py @@ -0,0 +1,73 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "02_request.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #send request to App1 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + expect_response_payload = {"key1":"value1","key2":"value2"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + #send request to App1 + ret = send_request("/res2", "DELETE", None) + if (ret != 66): + return False, '' + expect_response_payload = {} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/case.py new file mode 100644 index 000000000..3886cb820 --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/03-event/case.py @@ -0,0 +1,67 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "03_event.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #register event + ret = register("/alert/overheat", 2000, 5000) + if (ret != 69): + return False, '' + ret = check_get_event() + if (ret == False): + return False, '' + + #deregister event + ret = deregister("/alert/overheat") + if (ret != 69): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/case.py new file mode 100644 index 000000000..bf395f58b --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/04-request-internal/case.py @@ -0,0 +1,80 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "04_request_internal_resp.wasm") + if (ret != 65): + return False, '' + + #install App2 + ret = install_app("App2", "04_request_internal_req.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1","App2"]) + if (ret == False): + return False, '' + + #send request to App2 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + time.sleep(2) + expect_response_payload = {"key1":"value1","key2":"value2"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + #send request to App2 + ret = send_request("/res2", "GET", None) + if (ret != 69): + return False, '' + time.sleep(2) + expect_response_payload = {"key1":"value1","key2":"value2"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/case.py new file mode 100644 index 000000000..79c328749 --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/05-event-internal/case.py @@ -0,0 +1,70 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "05_event_internal_provider.wasm") + if (ret != 65): + return False, '' + + #install App2 + ret = install_app("App2", "05_event_internal_subscriber.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1","App2"]) + if (ret == False): + return False, '' + + #send request to App2 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + time.sleep(2) + expect_response_payload = {"key1":"value1","key2":"value2"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/case.py new file mode 100644 index 000000000..90af4d5d9 --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/06-timer/case.py @@ -0,0 +1,70 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "06_timer.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #send request to App1 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + + time.sleep(3) + + ret = send_request("/check_timer", "GET", None) + if (ret != 69): + return False, '' + expect_response_payload = {"num":2} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/case.py new file mode 100644 index 000000000..2bb756203 --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/07-sensor/case.py @@ -0,0 +1,65 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "07_sensor.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #send request to App1 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + time.sleep(2) + expect_response_payload = {"key1":"value1","key2":"value2"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/__init__.py diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/case.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/case.py new file mode 100644 index 000000000..99a4512ee --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/08-on-destroy/case.py @@ -0,0 +1,78 @@ +# +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +import sys +import time +import random +import logging +import json + +from framework.case_base import * +from framework.test_api import * +from harness.harness_api import * + +class CTestCase(CTestCaseBase): + def __init__(self, suite): + CTestCaseBase.__init__(self, suite) + + def get_case_name(self): + case_path = os.path.dirname(os.path.abspath( __file__ )) + return os.path.split(case_path)[1] + + def on_get_case_description(self): + return "startup the executables" + + def on_setup_case(self): + os.chdir(self.get_case_name()) + start_env() + api_log_error("on_setup_case OK") + return True, '' + + def on_cleanup_case(self): + stop_env() + api_log_error("on_cleanup_case OK") + return True, '' + + # called by the framework + def on_run_case(self): + time.sleep(0.5) + + #install App1 + ret = install_app("App1", "08_on_destroy.wasm") + if (ret != 65): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps(["App1"]) + if (ret == False): + return False, '' + + #send request to App1 + ret = send_request("/res1", "GET", None) + if (ret != 69): + return False, '' + time.sleep(2) + expect_response_payload = {"key1":"value1"} + ret = check_response_payload(expect_response_payload) + if (ret == False): + return False, '' + + #uninstall App1 + ret = uninstall_app("App1") + if (ret != 66): + return False, '' + + #query Apps + ret = query_app() + if (ret != 69): + return False, '' + ret = check_query_apps([]) + if (ret == False): + return False, '' + + return True, '' diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/__init__.py b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/component-test/suites/01-life-cycle/cases/__init__.py |