This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Janine Olear <[email protected]>
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Tests for the v2 AWS RHEL transformer.""" | ||
import filecmp | ||
import os | ||
|
||
from cloudimagedirectory import transformer | ||
|
||
|
||
def test_aws_v2_rhel_transformer_command(runner, tmp_path): | ||
"""Verify that we can transform AWS data for RHEL.""" | ||
result = runner.invoke( | ||
transformer.run, | ||
[ | ||
"-f", | ||
"tests/transformer/testdata/input/raw/aws/af-south-1.json", | ||
"-op=.", | ||
f"-dp={tmp_path}", | ||
"--filter.until=none", | ||
], | ||
) | ||
|
||
assert result.exit_code == 0, f"expected no error, but got code {result.exit_code} and output:\n{result.output}" | ||
|
||
# Ensure the directory was made. | ||
assert os.path.isdir(f"{tmp_path}/v2/os/rhel/provider/aws/version/6.10/region/af-south-1/image") | ||
|
||
# Get current directory | ||
pwd = os.getcwd() | ||
|
||
# Check image data by comparing the expected file and the output file byte by byte. | ||
assert filecmp.cmp( | ||
f"{pwd}/tests/transformer/testdata/expected/v2/os/rhel/provider/aws/version/6.10/region/af-south-1/image/4031b089d970c84bf7fad57831ba552e36517a3f", | ||
f"{tmp_path}/v2/os/rhel/provider/aws/version/6.10/region/af-south-1/image/4031b089d970c84bf7fad57831ba552e36517a3f", | ||
) |
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,33 @@ | ||
"""Tests for the v2 Azure RHEL transformer.""" | ||
import filecmp | ||
import os | ||
|
||
from cloudimagedirectory import transformer | ||
|
||
|
||
def test_aws_v2_rhel_transformer_command(runner, tmp_path): | ||
"""Verify that we can transform Azure data for RHEL.""" | ||
result = runner.invoke( | ||
transformer.run, | ||
[ | ||
"-f", | ||
"tests/transformer/testdata/input/raw/azure/eastus.json", | ||
"-op=.", | ||
f"-dp={tmp_path}", | ||
"--filter.until=none", | ||
], | ||
) | ||
|
||
assert result.exit_code == 0, f"expected no error, but got code {result.exit_code} and output:\n{result.output}" | ||
|
||
# Ensure the directory was made. | ||
assert os.path.isdir(f"{tmp_path}/v2/os/rhel/provider/azure/version/311.161/region/global/image") | ||
|
||
# Get current directory | ||
pwd = os.getcwd() | ||
|
||
# Check image data by comparing the expected file and the output file byte by byte. | ||
assert filecmp.cmp( | ||
f"{pwd}/tests/transformer/testdata/expected/v2/os/rhel/provider/azure/version/311.161/region/global/image/93212c01392a1e372edd399bde5838066089b22c", | ||
f"{tmp_path}/v2/os/rhel/provider/azure/version/311.161/region/global/image/93212c01392a1e372edd399bde5838066089b22c", | ||
) |
1 change: 1 addition & 0 deletions
1
...ovider/azure/version/311.161/region/global/image/93212c01392a1e372edd399bde5838066089b22c
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 @@ | ||
{"name": "osa osa_311 x64", "arch": "x64", "version": "311.161", "imageId": "RedHat:osa:osa_311:311.161.20200115", "date": "2020-01-15", "virt": "unknown"} |