Browse code

python-pyasn1-modules : fx make check.

Change-Id: I7a096d617c61d408d078a2460aff446ace179af2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3530
Reviewed-by: Chang Lee <changlee@vmware.com>
Tested-by: gerrit-photon <photon-checkins@vmware.com>

xiaolin-vmware authored on 2017/08/16 04:25:47
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        A collection of ASN.1-based protocols modules.
5 5
 Name:           python-pyasn1-modules
6 6
 Version:        0.0.8
7
-Release:        1%{?dist}
7
+Release:        2%{?dist}
8 8
 Url:            https://pypi.python.org/pypi/pyasn1-modules
9 9
 License:        BSD
10 10
 Group:          Development/Languages/Python
... ...
@@ -19,7 +19,10 @@ BuildRequires:  python2
19 19
 BuildRequires:  python2-libs
20 20
 BuildRequires:  python2-devel
21 21
 BuildRequires:  python-setuptools
22
-
22
+%if %{with_check}
23
+BuildRequires:  python-pyasn1
24
+%endif
25
+Requires:       python-pyasn1
23 26
 Requires:       python2
24 27
 Requires:       python2-libs
25 28
 
... ...
@@ -39,9 +42,12 @@ Summary:        python-pyasn1-modules
39 39
 BuildRequires:  python3
40 40
 BuildRequires:  python3-devel
41 41
 BuildRequires:  python3-libs
42
-
42
+%if %{with_check}
43
+BuildRequires:  python3-pyasn1
44
+%endif
43 45
 Requires:       python3
44 46
 Requires:       python3-libs
47
+Requires:       python3-pyasn1
45 48
 
46 49
 %description -n python3-pyasn1-modules
47 50
 
... ...
@@ -51,6 +57,7 @@ Python 3 version.
51 51
 %setup -q -n pyasn1-modules-%{version}
52 52
 rm -rf ../p3dir
53 53
 cp -a . ../p3dir
54
+find ../p3dir -iname "*.py" | xargs -I file sed -i '1s/python/python3/g' file
54 55
 
55 56
 %build
56 57
 python2 setup.py build
... ...
@@ -65,9 +72,16 @@ python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
65 65
 popd
66 66
 
67 67
 %check
68
-python2 setup.py test
69
-pushd ../p3dir
70
-python3 setup.py test
68
+pushd tools
69
+for file in ../test/*.sh; do
70
+    [ -f "$file" ] && chmod +x "$file" && PYTHONPATH=%{buildroot}%{python2_sitelib} "$file"
71
+done
72
+
73
+popd
74
+pushd ../p3dir/tools
75
+for file in ../test/*.sh; do
76
+    [ -f "$file" ] && chmod +x "$file" && PYTHONPATH=%{buildroot}%{python3_sitelib} "$file"
77
+done
71 78
 popd
72 79
 
73 80
 %files
... ...
@@ -79,5 +93,7 @@ popd
79 79
 %{python3_sitelib}/*
80 80
 
81 81
 %changelog
82
+*   Mon Aug 14 2017 Xiaolin Li <xiaolinl@vmware.com> 0.0.8-2
83
+-   Fixed make check.
82 84
 *   Mon Mar 13 2017 Xiaolin Li <xiaolinl@vmware.com> 0.0.8-1
83 85
 -   Initial packaging for Photon