parent
36c78f225a
commit
98f77e0c08
@ -8,7 +8,7 @@
|
|||||||
Summary: Device-mapper Persistent Data Tools
|
Summary: Device-mapper Persistent Data Tools
|
||||||
Name: device-mapper-persistent-data
|
Name: device-mapper-persistent-data
|
||||||
Version: 0.9.0
|
Version: 0.9.0
|
||||||
Release: 5%{?dist}%{?release_suffix}
|
Release: 6%{?dist}%{?release_suffix}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: https://github.com/jthornber/thin-provisioning-tools
|
URL: https://github.com/jthornber/thin-provisioning-tools
|
||||||
#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
|
#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
|
||||||
@ -34,7 +34,7 @@ BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel
|
|||||||
Requires: expat
|
Requires: expat
|
||||||
%ifarch %{rust_arches}
|
%ifarch %{rust_arches}
|
||||||
%if 0%{?rhel}
|
%if 0%{?rhel}
|
||||||
BuildRequires: rust-packaging
|
BuildRequires: rust-toolset
|
||||||
%else
|
%else
|
||||||
BuildRequires: rust-packaging
|
BuildRequires: rust-packaging
|
||||||
%endif
|
%endif
|
||||||
@ -157,6 +157,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools
|
|||||||
#% {_sbindir}/thin_show_duplicates
|
#% {_sbindir}/thin_show_duplicates
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 10 2021 Marian Csontos <mcsontos@redhat.com> - 0.9.0-6
|
||||||
|
- Remove rust-packaging dependency.
|
||||||
|
- Fix gating test syntax.
|
||||||
|
|
||||||
* Mon Jun 07 2021 Marian Csontos <mcsontos@redhat.com> - 0.9.0-5
|
* Mon Jun 07 2021 Marian Csontos <mcsontos@redhat.com> - 0.9.0-5
|
||||||
- Fix important issues found by static analysis.
|
- Fix important issues found by static analysis.
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ def thin_clean(args):
|
|||||||
|
|
||||||
def thin_test(args):
|
def thin_test(args):
|
||||||
print("\n#######################################\n")
|
print("\n#######################################\n")
|
||||||
print (
|
print(
|
||||||
"INFO: Testing thin tools runtime provided by device_mapper_persistent_data")
|
"INFO: Testing thin tools runtime provided by device_mapper_persistent_data")
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
@ -415,7 +415,7 @@ def thin_test(args):
|
|||||||
|
|
||||||
def thin_errors_test(args):
|
def thin_errors_test(args):
|
||||||
print("\n#######################################\n")
|
print("\n#######################################\n")
|
||||||
print (
|
print(
|
||||||
"INFO: Testing thin tools errors provided by device_mapper_persistent_data")
|
"INFO: Testing thin tools errors provided by device_mapper_persistent_data")
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
@ -845,7 +845,7 @@ def cache_clean(args):
|
|||||||
|
|
||||||
def cache_test(args):
|
def cache_test(args):
|
||||||
print("\n#######################################\n")
|
print("\n#######################################\n")
|
||||||
print ("INFO: Testing cache tools runtime provided by device_mapper_persistent_data")
|
print("INFO: Testing cache tools runtime provided by device_mapper_persistent_data")
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
|
|
||||||
@ -965,7 +965,7 @@ def cache_test(args):
|
|||||||
|
|
||||||
def cache_errors_test(args):
|
def cache_errors_test(args):
|
||||||
print("\n#######################################\n")
|
print("\n#######################################\n")
|
||||||
print ("INFO: Testing cache tools errors provided by device_mapper_persistent_data")
|
print("INFO: Testing cache tools errors provided by device_mapper_persistent_data")
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
|
|
||||||
@ -1223,10 +1223,10 @@ def main():
|
|||||||
cache_clean(args)
|
cache_clean(args)
|
||||||
|
|
||||||
if not TC.tend():
|
if not TC.tend():
|
||||||
print "FAIL: test failed"
|
print("FAIL: test failed")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "PASS: Test pass"
|
print("PASS: Test pass")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@ import sys, os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import fileinput
|
import fileinput
|
||||||
|
# TODO: Is this really necessary? Unlikely we will run into python2 in rawhide
|
||||||
|
# again...
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
|
||||||
def _print(string):
|
def _print(string):
|
||||||
@ -1042,7 +1045,7 @@ class LoopDev:
|
|||||||
_print("WARN: Could not create loop device image file")
|
_print("WARN: Could not create loop device image file")
|
||||||
return ret_fail
|
return ret_fail
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print >> sys.err, "command failed: ", e
|
print("command failed: ", e, file=sys.err)
|
||||||
return ret_fail
|
return ret_fail
|
||||||
|
|
||||||
loop_path = self._get_loop_path(name)
|
loop_path = self._get_loop_path(name)
|
||||||
@ -1125,7 +1128,7 @@ class LoopDev:
|
|||||||
name = self._standardize_name(name)
|
name = self._standardize_name(name)
|
||||||
|
|
||||||
# Just try to detach if device is connected, otherwise ignore
|
# Just try to detach if device is connected, otherwise ignore
|
||||||
# print "INFO: Checking if ", loop_path, " exists, to be detached"
|
# print("INFO: Checking if ", loop_path, " exists, to be detached")
|
||||||
dev_path = self._get_loop_path(name)
|
dev_path = self._get_loop_path(name)
|
||||||
if dev_path in devs:
|
if dev_path in devs:
|
||||||
cmd = "losetup -d %s" % dev_path
|
cmd = "losetup -d %s" % dev_path
|
||||||
@ -1199,7 +1202,7 @@ class LVM:
|
|||||||
cmd = "vgcreate %s %s %s" % (options, vg_name, pv_name)
|
cmd = "vgcreate %s %s %s" % (options, vg_name, pv_name)
|
||||||
retcode = run(cmd, verbose=verbose)
|
retcode = run(cmd, verbose=verbose)
|
||||||
if (retcode != 0):
|
if (retcode != 0):
|
||||||
# _print ("WARN: Could not create %s" % vg_name)
|
# _print("WARN: Could not create %s" % vg_name)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -1321,7 +1324,7 @@ class LVM:
|
|||||||
cmd = "lvcreate %s %s -n %s" % (" ".join(str(i) for i in options), vg_name, lv_name)
|
cmd = "lvcreate %s %s -n %s" % (" ".join(str(i) for i in options), vg_name, lv_name)
|
||||||
retcode = run(cmd, verbose=verbose)
|
retcode = run(cmd, verbose=verbose)
|
||||||
if (retcode != 0):
|
if (retcode != 0):
|
||||||
# _print ("WARN: Could not create %s" % lv_name)
|
# _print("WARN: Could not create %s" % lv_name)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -1514,7 +1517,7 @@ class DMPD:
|
|||||||
_print("WARN: Could not create file to %s metadata to." % command_message)
|
_print("WARN: Could not create file to %s metadata to." % command_message)
|
||||||
return False
|
return False
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print >> sys.err, "command failed: ", e
|
print("command failed: ", e, file=sys.err)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -20,19 +20,19 @@ import sys
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def run(cmd):
|
def run(cmd):
|
||||||
print "INFO: Running '%s'..." % cmd
|
print("INFO: Running '%s'..." % cmd)
|
||||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
|
|
||||||
retcode = p.returncode
|
retcode = p.returncode
|
||||||
output = stdout + stderr
|
output = stdout + stderr
|
||||||
print output
|
print(output)
|
||||||
return retcode, output
|
return retcode, output
|
||||||
|
|
||||||
def start_test():
|
def start_test():
|
||||||
|
|
||||||
#if uses any library linked to /usr this my affect the tools during boot
|
#if uses any library linked to /usr this my affect the tools during boot
|
||||||
print ("INFO: Making sure tools provided by device-mapper-persistent-data "
|
print("INFO: Making sure tools provided by device-mapper-persistent-data "
|
||||||
"are not linked to /usr")
|
"are not linked to /usr")
|
||||||
|
|
||||||
#Paths where we should have no libraries linked from
|
#Paths where we should have no libraries linked from
|
||||||
@ -54,7 +54,7 @@ def start_test():
|
|||||||
continue
|
continue
|
||||||
tool_error = 0
|
tool_error = 0
|
||||||
for lib_path in lib_paths:
|
for lib_path in lib_paths:
|
||||||
print "INFO: Checking if %s is not linked to libraries at %s" % (tool, lib_path)
|
print("INFO: Checking if %s is not linked to libraries at %s" % (tool, lib_path))
|
||||||
ret, linked_lib = run("ldd %s" % tool)
|
ret, linked_lib = run("ldd %s" % tool)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
print("FAIL: Could not list dynamically libraries for %s" % (tool))
|
print("FAIL: Could not list dynamically libraries for %s" % (tool))
|
||||||
@ -83,10 +83,10 @@ def start_test():
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
if not start_test():
|
if not start_test():
|
||||||
print "FAIL: test failed"
|
print("FAIL: test failed")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "PASS: Test pass"
|
print("PASS: Test pass")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user