Use tmt and osci for gating

Add smoke test

Assisted-by: Claude Code
This commit is contained in:
Lukáš Zachar 2026-07-07 15:42:50 +02:00
parent 83527c74ae
commit aaaa0121d7
5 changed files with 50 additions and 1 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -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}

5
plan.fmf Normal file
View File

@ -0,0 +1,5 @@
execute:
how: tmt
discover:
how: fmf

6
tests/test_image.fmf Normal file
View File

@ -0,0 +1,6 @@
require:
- python3-pillow
test: |
trap 'rm -f foo.png' EXIT
/usr/libexec/platform-python test_image.py

35
tests/test_image.py Normal file
View File

@ -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!")