From c92ff6266b18a9655edef231391739f0479dfb3a Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sun, 4 Sep 2022 18:49:42 +0300 Subject: add tests and ci workflow for running tests This commit adds tests (using python3 pytest framework): 1. Test basic accel-cmd commands (show version, show stat, etc) 2. Test ipoe shared session up (dhcpv4) without radius 3. Test pppoe discovery (without PADO delay) 4. Test pppoe discovery (without PADO delay) 5. Test pppoe session up (ipv4) without radius 6. Test vlan creation using vlan-mon (pppoe) These tests require external utils. Please read tests/README.md how to setup environment, how to run the tests and how to generate coverage report Also, run-tests.yml contains step-by-step instruction how to run the tests Signed-off-by: Sergey V. Lobanov --- tests/common/process.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/common/process.py (limited to 'tests/common/process.py') diff --git a/tests/common/process.py b/tests/common/process.py new file mode 100644 index 0000000..e0c6136 --- /dev/null +++ b/tests/common/process.py @@ -0,0 +1,7 @@ +from subprocess import Popen, PIPE + +def run(command): + process = Popen(command, stdout=PIPE, stderr=PIPE) + (out, err) = process.communicate() + exit_code = process.wait() + return (exit_code, out.decode("utf-8"), err.decode("utf-8")) \ No newline at end of file -- cgit v1.2.3