tests: Add simple test for python-pycdio
This is a simple tmt test demonstrating that the installed library can be used. Resolves: RHEL-75941
This commit is contained in:
parent
cdf0ca9e36
commit
64067d247b
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-10
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
11
plans/run-test.fmf
Normal file
11
plans/run-test.fmf
Normal file
@ -0,0 +1,11 @@
|
||||
summary: Run python-pycdio tests
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- python3-pycdio
|
||||
- xorriso
|
||||
|
||||
execute:
|
||||
script: |
|
||||
mkisofs -V "PYCDIO TEST" -o ./test.iso ./tests/
|
||||
./tests/scripts/print-iso-volid ./test.iso | grep "PYCDIO TEST"
|
19
tests/scripts/print-iso-volid
Executable file
19
tests/scripts/print-iso-volid
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import iso9660
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(f"USAGE: {sys.argv[0]} ISOFILE", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
iso = iso9660.ISO9660.IFS(source=sys.argv[1])
|
||||
if not iso.is_open():
|
||||
raise RuntimeError(f"error opening file: {sys.argv[1]}")
|
||||
|
||||
label = iso.get_volume_id()
|
||||
if label is None:
|
||||
raise RuntimeError("error reading volume id")
|
||||
|
||||
print(f"LABEL = {label}")
|
||||
sys.exit(0)
|
Loading…
Reference in New Issue
Block a user