-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration_tests: add the integration tests for task #95
Added tests are focused on the following issue: #95 Signed-off-by: Mykhailo Androsiuk <[email protected]>
- Loading branch information
Mykhailo Androsiuk
committed
Jan 17, 2024
1 parent
cab499c
commit d05c70e
Showing
14 changed files
with
4,694 additions
and
0 deletions.
There are no files selected for viewing
749 changes: 749 additions & 0 deletions
749
...etcher/test_negative_tar_archive_missing/resources/test_negative_tar_archive_missing.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...sts/unpack_fetcher/test_negative_tar_archive_missing/test_negative_tar_archive_missing.py
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,35 @@ | ||
import subprocess | ||
import pytest | ||
import os | ||
import tempfile | ||
|
||
|
||
@pytest.mark.integration | ||
def test_negative_tar_archive_missing(): | ||
script_path = os.path.abspath(__file__) | ||
script_dir_path = os.path.dirname(script_path) | ||
yaml_file = os.path.join(script_dir_path, "resources/test_negative_tar_archive_missing.yaml") | ||
archive_name = "rcar-prebuilts-graphics-xt-doma.tar.gz" | ||
|
||
with tempfile.TemporaryDirectory(dir=script_dir_path) as tmp_dir: | ||
|
||
result = subprocess.run(["python", "../../../../../moulin.py", yaml_file, "--ENABLE_ANDROID", "yes", | ||
"--ANDROID_PREBUILT_DDK", "yes"], | ||
cwd=tmp_dir, | ||
stderr=subprocess.PIPE, | ||
text=True) | ||
|
||
assert result.returncode == 0, ("The return code is equal to '0'") | ||
|
||
result = subprocess.run(["ninja", ".stamps/rcar-prebuilts-graphics-xt-doma.tar.gz.stamp"], | ||
cwd=tmp_dir, | ||
stderr=subprocess.PIPE, | ||
text=True) | ||
|
||
assert result.returncode != 0, ("The return code is not equal to '0'") | ||
assert archive_name in result.stderr, "The expected warning message is missing" | ||
assert "missing and no known rule to make it" in result.stderr, "The expected warning message is missing" | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main([__file__]) |
Oops, something went wrong.