Commit a8832a47 authored by Guangyuan Yang's avatar Guangyuan Yang Committed by Mattia Rizzolo

tests: iso9660: support isoinfo's output coming from cdrtools' version instead of genisoimage's

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 7a526a61
......@@ -18,6 +18,7 @@
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import pytest
import subprocess
from diffoscope.config import Config
from diffoscope.comparators.missing_file import MissingFile
......@@ -30,6 +31,15 @@ from ..utils.tools import skip_unless_tools_exist
iso1 = load_fixture('test1.iso')
iso2 = load_fixture('test2.iso')
def is_cdrtools():
try:
if b"Schilling" in subprocess.check_output(['isoinfo', '--version']):
return True
else:
return False
except:
return None
def test_identification(iso1):
assert isinstance(iso1, Iso9660File)
......@@ -43,12 +53,18 @@ def differences(iso1, iso2):
@skip_unless_tools_exist('isoinfo')
def test_iso9660_content(differences):
expected_diff = get_data('iso9660_content_expected_diff')
if is_cdrtools():
expected_diff = get_data('iso9660_content_expected_diff_cdrtools')
else:
expected_diff = get_data('iso9660_content_expected_diff')
assert differences[0].unified_diff == expected_diff
@skip_unless_tools_exist('isoinfo')
def test_iso9660_rockridge(differences):
expected_diff = get_data('iso9660_rockridge_expected_diff')
if is_cdrtools():
expected_diff = get_data('iso9660_rockridge_expected_diff_cdrtools')
else:
expected_diff = get_data('iso9660_rockridge_expected_diff')
assert differences[1].unified_diff == expected_diff
@skip_unless_tools_exist('isoinfo')
......
@@ -1,7 +1,7 @@
Directory listing of /
dr-xr-xr-x 1 0 0 2048 Jun 24 2015 [ 23 02] .
dr-xr-xr-x 1 0 0 2048 Jun 24 2015 [ 23 02] ..
-r-xr-xr-x 1 0 0 0 Jun 24 2015 [ 25 00] LINK.;1
-r-xr-xr-x 1 0 0 0 Jun 24 2015 [ 25 00] NULL.;1
--r-xr-xr-x 1 0 0 446 Jun 24 2015 [ 25 00] TEXT.;1
+-r-xr-xr-x 1 0 0 671 Jun 24 2015 [ 25 00] TEXT.;1
@@ -1,7 +1,7 @@
Directory listing of /
drwxr-xr-x 2 1000 1000 2048 Jun 24 2015 [ 23 02] .
drwxr-xr-x 2 1000 1000 2048 Jun 24 2015 [ 23 02] ..
-lrwxrwxrwx 1 1000 1000 0 Jun 24 2015 [ 25 00] link -> broken
+lrwxrwxrwx 1 1000 1000 0 Jun 24 2015 [ 25 00] link -> really-broken
crw-r--r-- 1 0 0 0 Jun 24 2015 [ 25 00] null
--rw-r--r-- 1 1000 1000 446 Jun 24 2015 [ 25 00] text
+-rw-r--r-- 1 1000 1000 671 Jun 24 2015 [ 25 00] text
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment