diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml index eb7c84f..d74bf08 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,6 +1,8 @@ --- !Policy + product_versions: - rhel-8 decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} + diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..9eca07f --- /dev/null +++ b/plan.fmf @@ -0,0 +1,5 @@ +execute: + how: tmt + +discover: + how: fmf diff --git a/tests/test_image.fmf b/tests/test_image.fmf new file mode 100644 index 0000000..3e1c6e3 --- /dev/null +++ b/tests/test_image.fmf @@ -0,0 +1,6 @@ +require: +- python3-pillow + +test: | + trap 'rm -f foo.png' EXIT + /usr/libexec/platform-python test_image.py diff --git a/tests/test_image.py b/tests/test_image.py new file mode 100644 index 0000000..4eff719 --- /dev/null +++ b/tests/test_image.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +""" +Simple test script for Pillow library. +Creates a 10x10 image with yellow background and green square in the middle. +""" + +from PIL import Image, ImageDraw + +print("Creating 10x10 image...") +img = Image.new('RGB', (10, 10), color='yellow') +draw = ImageDraw.Draw(img) +draw.rectangle([(3, 3), (6, 6)], fill='green') + +img.save('foo.png') +print("Image saved as foo.png") + +print("\nLoading and verifying image...") + +loaded_img = Image.open('foo.png') + +assert loaded_img.format == 'PNG', f"Expected PNG format, got {loaded_img.format}" +print(f"✓ Format is PNG") + +assert loaded_img.size == (10, 10), f"Expected size (10, 10), got {loaded_img.size}" +print(f"✓ Size is 10x10") + +pixel_yellow = loaded_img.getpixel((2, 2)) +assert pixel_yellow == (255, 255, 0), f"Expected yellow (255, 255, 0) at (2, 2), got {pixel_yellow}" +print(f"✓ Yellow color found at (2, 2): {pixel_yellow}") + +pixel_green = loaded_img.getpixel((5, 5)) +assert pixel_green == (0, 128, 0), f"Expected green (0, 128, 0) at (5, 5), got {pixel_green}" +print(f"✓ Green color found at (5, 5): {pixel_green}") + +print("\n✓ All tests passed!")