tests: migrate STI tests to TMT

This commit is contained in:
Lukáš Zaoral 2025-06-24 15:09:24 +02:00
commit 830dbbe0e0
No known key found for this signature in database
GPG key ID: 39157506DD67752D
5 changed files with 22 additions and 46 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -0,0 +1,6 @@
summary: Calculate Silvester Number
framework: shell
test: ./test.sh
component: mpfr
recommends:
- gawk

10
tests/silvester-number/test.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh -eux
OUT="$(gawk -M 'BEGIN {
s = 2
for (i = 1; i <= 7; i++)
s = s * (s - 1) + 1
print s
}')"
test "$OUT" = "113423713055421844361000443"

View file

@ -1,46 +0,0 @@
- hosts: all
vars:
- ansible_python_interpreter: /usr/bin/python3
- artifacts: ./artifacts
tags:
- classic
- container
- atomic
tasks:
- name: create artifacts
file:
path: "{{ artifacts }}"
state: directory
delegate_to: localhost
- name: do it all
block:
- name: calculate Silvester number
command: |
gawk -M 'BEGIN {
s = 2
for (i = 1; i <= 7; i++)
s = s * (s - 1) + 1
print s
}'
register: silvester
- name: verify Silvester number
fail:
when: silvester.stdout != '113423713055421844361000443'
always:
- name: write log
copy:
content: |
stderr:
{{ silvester.stderr }}
stdout:
{{ silvester.stdout }}
dest: "{{ artifacts }}/test.log"
delegate_to: localhost
# fetch:
# dest: "{{ artifacts }}/"
# src: "/tmp/test.log"
# flat: yes