This is a simple tmt test demonstrating that the installed library can be used. Resolves: RHEL-75941
20 lines
411 B
Python
Executable File
20 lines
411 B
Python
Executable File
#!/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)
|