Hello, Thats what the shutil.which led to! My fault, I didn't notice the tiny _new in 3.3_ in the python docs and hence the chaos.
Regards, Kshitij Gupta On Thu, Sep 5, 2013 at 11:13 PM, Christian Boltz <[email protected]> wrote: > Hello, > > Testing/* gives me some failures for the minitools with py2and py3: > > # ./runtests-py2.sh > [...] > running minitools_test.py... > Traceback (most recent call last): > File "./../Tools/aa-audit", line 15, in <module> > audit.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > E.Traceback (most recent call last): > File "./../Tools/aa-complain", line 15, in <module> > complain.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > ETraceback (most recent call last): > File "./../Tools/aa-disable", line 15, in <module> > disable.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > ETraceback (most recent call last): > File "./../Tools/aa-enforce", line 17, in <module> > enforce.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > E > ====================================================================== > ERROR: test_audit (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 13, in test_audit > subprocess.check_output('python ./../Tools/aa-audit -d ./profiles ntpd', > shell=True) > File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output > raise CalledProcessError(retcode, cmd, output=output) > CalledProcessError: Command 'python ./../Tools/aa-audit -d ./profiles ntpd' > returned non-zero exit status 1 > > ====================================================================== > ERROR: test_complain (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 27, in test_complain > subprocess.check_output('python ./../Tools/aa-complain -d ./profiles > ntpd', shell=True) > File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output > raise CalledProcessError(retcode, cmd, output=output) > CalledProcessError: Command 'python ./../Tools/aa-complain -d ./profiles > ntpd' returned non-zero exit status 1 > > ====================================================================== > ERROR: test_disable (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 80, in test_disable > subprocess.check_output('python ./../Tools/aa-disable -d ./profiles > ntpd', shell=True) > File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output > raise CalledProcessError(retcode, cmd, output=output) > CalledProcessError: Command 'python ./../Tools/aa-disable -d ./profiles ntpd' > returned non-zero exit status 1 > > ====================================================================== > ERROR: test_enforce (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 62, in test_enforce > subprocess.check_output('python ./../Tools/aa-enforce -d ./profiles -r > ntpd', shell=True) > File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output > raise CalledProcessError(retcode, cmd, output=output) > CalledProcessError: Command 'python ./../Tools/aa-enforce -d ./profiles -r > ntpd' returned non-zero exit status 1 > > ---------------------------------------------------------------------- > Ran 5 tests in 0.718s > > FAILED (errors=4) > > > > > # ./runtests-py3.sh > running minitools_test.py... > Traceback (most recent call last): > File "./../Tools/aa-audit", line 15, in <module> > audit.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > E.Traceback (most recent call last): > File "./../Tools/aa-complain", line 15, in <module> > complain.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > ETraceback (most recent call last): > File "./../Tools/aa-disable", line 15, in <module> > disable.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > ETraceback (most recent call last): > File "./../Tools/aa-enforce", line 17, in <module> > enforce.act() > File "/usr/lib/python2.7/site-packages/apparmor/tools.py", line 44, in act > which = apparmor.which(p) > File "/usr/lib/python2.7/site-packages/apparmor/aa.py", line 155, in which > return shutil.which(file) > AttributeError: 'module' object has no attribute 'which' > E > ====================================================================== > ERROR: test_audit (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 13, in test_audit > subprocess.check_output('python ./../Tools/aa-audit -d ./profiles ntpd', > shell=True) > File "/usr/lib64/python3.3/subprocess.py", line 586, in check_output > raise CalledProcessError(retcode, process.args, output=output) > subprocess.CalledProcessError: Command 'python ./../Tools/aa-audit -d > ./profiles ntpd' returned non-zero exit status 1 > > ====================================================================== > ERROR: test_complain (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 27, in test_complain > subprocess.check_output('python ./../Tools/aa-complain -d ./profiles > ntpd', shell=True) > File "/usr/lib64/python3.3/subprocess.py", line 586, in check_output > raise CalledProcessError(retcode, process.args, output=output) > subprocess.CalledProcessError: Command 'python ./../Tools/aa-complain -d > ./profiles ntpd' returned non-zero exit status 1 > > ====================================================================== > ERROR: test_disable (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 80, in test_disable > subprocess.check_output('python ./../Tools/aa-disable -d ./profiles > ntpd', shell=True) > File "/usr/lib64/python3.3/subprocess.py", line 586, in check_output > raise CalledProcessError(retcode, process.args, output=output) > subprocess.CalledProcessError: Command 'python ./../Tools/aa-disable -d > ./profiles ntpd' returned non-zero exit status 1 > > ====================================================================== > ERROR: test_enforce (__main__.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "minitools_test.py", line 62, in test_enforce > subprocess.check_output('python ./../Tools/aa-enforce -d ./profiles -r > ntpd', shell=True) > File "/usr/lib64/python3.3/subprocess.py", line 586, in check_output > raise CalledProcessError(retcode, process.args, output=output) > subprocess.CalledProcessError: Command 'python ./../Tools/aa-enforce -d > ./profiles -r ntpd' returned non-zero exit status 1 > > ---------------------------------------------------------------------- > Ran 5 tests in 0.697s > > FAILED (errors=4) > > > > > > BTW: > > ==> runtests-py2.sh <== > for file in *.py ; do echo "running $file..." ; python $file; echo; done > > ==> runtests-py3.sh <== > for file in *.py ; do echo "running $file..." ; python3 $file; echo; done > > > You might want to include those scripts in the Testing/ directory ;-) > > > > Regards, > > Christian Boltz > -- > Lieber WoKo, > bitte versuche in Zukunft, sig-gerecht zu schreiben, d.h etwa > auf 3 Zeilen Kürzen. Danke. ;-) [Christopher Brosch in dafb] > > > -- > AppArmor mailing list > [email protected] > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/apparmor -- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
