How do I test the integrity of a Python installation in Debian andUbuntu

G

Geoff Gardiner

How do I assure myself of the integrity of a Python installation
acquired using apt-get install on Debian and Ubuntu?

I can run regrtest but there's nothing in the basic installation to run,
viz.:

gegard@gegard:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.test_grammar
test_grammar skipped -- No module named test_grammar
.... <etc> more of the same...
9 tests skipped:
test_builtin test_doctest test_doctest2 test_exceptions
test_grammar test_opcodes test_operations test_types test_unittest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/test/regrtest.py", line 416, in main
e = _ExpectedSkips()
File "/usr/lib/python2.5/test/regrtest.py", line 1321, in __init__
from test import test_socket_ssl
ImportError: cannot import name test_socket_ssl
I don't see where to go from here, so advice would be extremely helpful.

Background

I have a large Python-based system that I am trying to install on an
externally-hosted VM. It doesn't build and install correctly most of the
time, and I have tried successive images of Debian Lenny and Ubuntu
Hardy with mostly different build/installation results each time.

The installation proceeds Ok on a local Ubuntu VM.

A number of modules are installed in addition to python, but I can't
even see how to test the core python installation. There are few
test_*.py files in the installation.

I have previously encountered a fault on the server hosting the VM and
would like to be more comfortable that the python installation itself is
Ok (or have evidence that it's not).

Thank you,
Geoff
 
A

Aahz

How do I assure myself of the integrity of a Python installation
acquired using apt-get install on Debian and Ubuntu?

How important is the apt-get requirement? Building Python yourself in
this situation sounds like it would be simpler/safer.
 
G

Geoff Gardiner

Aahz said:
How important is the apt-get requirement?

That's a significant point, thank you. Two parts to the response:

a) I don't feel that I am sufficiently expert to launch into compilation
of Python if I can avoid it.

b) I hope that I can put all platform risk into the lap of the hosting
provider, and apt-get is probably the only delivery mechanism they will
take any responsibility for. (I want to use their 'standard'.)

All the best,
Geoff
 
A

Aahz

gegard@gegard:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.test_grammar
test_grammar skipped -- No module named test_grammar
... <etc> more of the same...
9 tests skipped:
test_builtin test_doctest test_doctest2 test_exceptions
test_grammar test_opcodes test_operations test_types test_unittest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/test/regrtest.py", line 416, in main
e = _ExpectedSkips()
File "/usr/lib/python2.5/test/regrtest.py", line 1321, in __init__
from test import test_socket_ssl
ImportError: cannot import name test_socket_ssl

What directory are you running this from? What happens if you switch to
running "python Lib/test/regrtest.py"? Taking a closer look, this looks
more like a plain import error.
 
G

Geoff Gardiner

Aahz said:
....
What directory are you running this from? What happens if you switch to
running "python Lib/test/regrtest.py"? Taking a closer look, this looks
more like a plain import error.

Thank you for your suggestion.

I couldn't do quite that because there's no Lib, but instead (in Ubuntu
Hardy, this time):
.....
gegard@gegard:~$ cd /usr/lib/python2.5/
gegard@gegard:/usr/lib/python2.5$ python test/regrtest.py
test_grammar
test_grammar skipped -- No module named test_grammar
test_opcodes
test_opcodes skipped -- No module named test_opcodes
test_operations
test_operations skipped -- No module named test_operations
test_builtin
test_builtin skipped -- No module named test_builtin
test_exceptions
test_exceptions skipped -- No module named test_exceptions
test_types
test_types skipped -- No module named test_types
test_unittest
test_unittest skipped -- No module named test_unittest
test_doctest
test_doctest skipped -- No module named test_doctest
test_doctest2
test_doctest2 skipped -- No module named test_doctest2
9 tests skipped:
test_builtin test_doctest test_doctest2 test_exceptions
test_grammar test_opcodes test_operations test_types test_unittest
Traceback (most recent call last):
File "test/regrtest.py", line 1384, in <module>
main()
File "test/regrtest.py", line 416, in main
e = _ExpectedSkips()
File "test/regrtest.py", line 1321, in __init__
from test import test_socket_ssl
ImportError: cannot import name test_socket_ssl
gegard@gegard:/usr/lib/python2.5$

Also
gegard@gegard:~$ locate */test_socket_ssl.*
gegard@gegard:~$ #returns nothing

And
gegard@gegard:~$ locate /usr/lib/python2.5/test/test_*.*
/usr/lib/python2.5/test/test_support.py
/usr/lib/python2.5/test/test_support.pyc
gegard@gegard:~$

All the best,
Geoff
 
L

Lawrence D'Oliveiro

Geoff said:
How do I assure myself of the integrity of a Python installation
acquired using apt-get install on Debian and Ubuntu?

apt-get install debsums
man debsums
 
A

Aahz

I couldn't do quite that because there's no Lib, but instead (in Ubuntu
Hardy, this time):
....
gegard@gegard:~$ cd /usr/lib/python2.5/
gegard@gegard:/usr/lib/python2.5$ python test/regrtest.py

9 tests skipped:
test_builtin test_doctest test_doctest2 test_exceptions
test_grammar test_opcodes test_operations test_types test_unittest
Traceback (most recent call last):
File "test/regrtest.py", line 1384, in <module>
main()
File "test/regrtest.py", line 416, in main
e = _ExpectedSkips()
File "test/regrtest.py", line 1321, in __init__
from test import test_socket_ssl
ImportError: cannot import name test_socket_ssl
gegard@gegard:/usr/lib/python2.5$

Also
gegard@gegard:~$ locate */test_socket_ssl.*
gegard@gegard:~$ #returns nothing

And
gegard@gegard:~$ locate /usr/lib/python2.5/test/test_*.*
/usr/lib/python2.5/test/test_support.py
/usr/lib/python2.5/test/test_support.pyc
gegard@gegard:~$

That seems to demonstrate that regrtest.py is indeed a good mechanism for
finding out whether it's a b0rked install!
 
G

Geoff Gardiner

Aahz said:
... That seems to demonstrate that regrtest.py is indeed a good mechanism for
finding out whether it's a b0rked install!

I agree that regrtest.py looks a good mechanism. It just appears that
`apt-get install python` on Debian and Ubuntu brings no tests with it.

@Lawrence D'Oliveiro:

`apt-get install debsums` does indeed show that the packages that it checks have matching checksums. `debsums [-a] python` checks all sorts of /usr/share/doc/python files while `debsums [-a] python2.5` checks /usr/share/doc/python2.5, /usr/lib/python2.5 and others as well. Although that wasn't what I was originally looking for it has been helpful.

Thank you for your suggestions.

All the best,
Geoff
 
L

Lawrence D'Oliveiro

Geoff said:
@Lawrence D'Oliveiro:
...

I see that you published my unobfuscated e-mail address on USENET for all to
see. I obfuscated it for a reason, to keep the spammers away. I'm assuming
this was a momentary lapse of judgement, for which I expect an apology.
Otherwise, it becomes grounds for an abuse complaint to your ISP.
 
G

Geoff Gardiner

Lawrence said:
.. I expect an apology.
Otherwise, it becomes grounds for an abuse complaint to your ISP.
Yes, I do apologize profusely and publicly, and would have done so
regardless of threat.

I had trouble with posts making it through to the list and so was also
posting in parallel to the original posters. In doing so, your address
initially bounced the message - so I changed it unthinkingly in a to: line.

I did not realize until this morning that they made it through
python-list unchanged, as they obviously do.

All the best,
Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top