-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial automation of integration tests
- Loading branch information
Showing
49 changed files
with
645 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ venv/ | |
|
||
*.whl | ||
|
||
test_apps/build | ||
test_apps/install | ||
integration_tests/build | ||
integration_tests/install | ||
|
||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Integration Test Applications | ||
|
||
The integration test applications use the vsomeip library in order to stimulate the someipy applications. | ||
|
||
Each test application has a corresponding someipy example application, which are started together. The test applications can be either started manually or run automatically using the scripts `run_all.py` in `automated_tests`. The script will launch each pair of applications (a someipy app and a vsomeip app). After running both applications, the script will evaluate the logfiles. | ||
|
||
## Build Test Applications using CMake | ||
|
||
```bash | ||
rm -rf build install && mkdir -p build && cd build && cmake .. && make && make install && cd .. | ||
``` | ||
|
||
## Setup Python Pip Package from Source | ||
|
||
```bash | ||
python3 -m pip install -e . | ||
``` | ||
|
||
### Network Setup Linux | ||
|
||
```bash | ||
sudo ip addr add 127.0.0.2/8 dev lo | ||
sudo ip addr add 224.224.224.245 dev lo autojoin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from test_base import TestBase | ||
|
||
|
||
class TestCallMethodTcp(TestBase): | ||
|
||
def __init__(self, repository, ld_library_path=None, interface_ip="127.0.0.1"): | ||
super().__init__() | ||
|
||
self.ld_library_path = ld_library_path | ||
self.vsomeip_app = [ | ||
f"{repository}/test_apps/install/call_method_tcp/call_method_tcp" | ||
] | ||
self.someipy_app = [ | ||
"python3", | ||
f"{repository}/example_apps/call_method_tcp.py", | ||
f"--interface_ip {interface_ip}", | ||
] | ||
self.vsomeip_config = ( | ||
f"{repository}/test_apps/install/call_method_tcp/vsomeip-client.json" | ||
) | ||
|
||
def evaluate(self) -> bool: | ||
method_calls = 0 | ||
responses = 0 | ||
for l in self.output_someipy_app: | ||
if "Received result for method" in l: | ||
responses += 1 | ||
if "Try to call method" in l: | ||
method_calls += 1 | ||
|
||
print(f"Method calls: {method_calls}. Responses: {responses}") | ||
difference = method_calls - responses | ||
tolerance = max(0.1 * method_calls, 1) | ||
if abs(difference) <= tolerance and method_calls > 0 and responses > 0: | ||
return True | ||
else: | ||
print(f"Method calls: {method_calls}. Responses: {responses}") | ||
self.print_outputs() | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from test_base import TestBase | ||
|
||
|
||
class TestCallMethodUdp(TestBase): | ||
|
||
def __init__(self, repository, ld_library_path=None, interface_ip="127.0.0.1"): | ||
super().__init__() | ||
|
||
self.ld_library_path = ld_library_path | ||
self.vsomeip_app = [ | ||
f"{repository}/test_apps/install/call_method_udp/call_method_udp" | ||
] | ||
self.someipy_app = [ | ||
"python3", | ||
f"{repository}/example_apps/call_method_udp.py", | ||
f"--interface_ip {interface_ip}", | ||
] | ||
self.vsomeip_config = ( | ||
f"{repository}/test_apps/install/call_method_udp/vsomeip-client.json" | ||
) | ||
|
||
def evaluate(self) -> bool: | ||
method_calls = 0 | ||
responses = 0 | ||
for l in self.output_someipy_app: | ||
if "Received result for method" in l: | ||
responses += 1 | ||
if "Try to call method" in l: | ||
method_calls += 1 | ||
|
||
print(f"Method calls: {method_calls}. Responses: {responses}") | ||
difference = method_calls - responses | ||
tolerance = max(0.1 * method_calls, 1) | ||
if abs(difference) <= tolerance and method_calls > 0 and responses > 0: | ||
return True | ||
else: | ||
print(f"Method calls: {method_calls}. Responses: {responses}") | ||
self.print_outputs() | ||
return False |
Oops, something went wrong.