Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_commands assumes ls is in /bin #35839

Closed
prjsf mannequin opened this issue Dec 27, 2001 · 11 comments
Closed

test_commands assumes ls is in /bin #35839

prjsf mannequin opened this issue Dec 27, 2001 · 11 comments
Assignees
Labels
build The build process and cross-build

Comments

@prjsf
Copy link
Mannequin

prjsf mannequin commented Dec 27, 2001

BPO 497160
Nosy @mwhudson, @gvanrossum, @sjoerdmullender, @freddrake

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/freddrake'
closed_at = <Date 2002-04-01.23:58:00.000>
created_at = <Date 2001-12-27.21:38:45.000>
labels = ['build']
title = 'test_commands assumes ls is in /bin'
updated_at = <Date 2002-04-01.23:58:00.000>
user = 'https://bugs.python.org/prjsf'

bugs.python.org fields:

activity = <Date 2002-04-01.23:58:00.000>
actor = 'fdrake'
assignee = 'fdrake'
closed = True
closed_date = None
closer = None
components = ['Build']
creation = <Date 2001-12-27.21:38:45.000>
creator = 'prjsf'
dependencies = []
files = []
hgrepos = []
issue_num = 497160
keywords = []
message_count = 11.0
messages = ['8513', '8514', '8515', '8516', '8517', '8518', '8519', '8520', '8521', '8522', '8523']
nosy_count = 5.0
nosy_names = ['mwh', 'gvanrossum', 'sjoerd', 'fdrake', 'prjsf']
pr_nums = []
priority = 'normal'
resolution = 'accepted'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue497160'
versions = ['Python 2.2']

@prjsf
Copy link
Mannequin Author

prjsf mannequin commented Dec 27, 2001

I got this test failure while building Python 2.2:
test test_commands failed -- Traceback (most recent
call last):
File "./Lib/test/test_commands.py", line 43, in
test_getstatus
self.assert_(re.match(pat, getstatus("/bin/ls"),
re.VERBOSE))
File
"/fs/home/mount/home/prj/b/Python-2.2/Lib/unittest.py",
line 262, in failUnless
if not expr: raise self.failureException, msg
AssertionError

My ls happens to be somewhere other than /bin. It would
be nice if the test used a different file, such as "/",
".", or even "./Lib/test/test_commands.py".

@prjsf prjsf mannequin closed this as completed Dec 27, 2001
@prjsf prjsf mannequin assigned freddrake Dec 27, 2001
@prjsf prjsf mannequin added the build The build process and cross-build label Dec 27, 2001
@prjsf prjsf mannequin closed this as completed Dec 27, 2001
@prjsf prjsf mannequin assigned freddrake Dec 27, 2001
@prjsf prjsf mannequin added the build The build process and cross-build label Dec 27, 2001
@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

I think you are going to get in a lot of trouble when
/bin/ls doesn't exist. It's not worth fixing the test suite
for this.

@prjsf
Copy link
Mannequin Author

prjsf mannequin commented Dec 28, 2001

Logged In: YES
user_id=412110

The test suite already uses $PATH to *run* ls (as does other
software, which is why I don't get into a lot of trouble).
It merely uses /bin/ls as a filename to pass to ls so it can
check the output. Any other filename will do just as well
here, and the fix is extremely simple; what's the benefit of
listing /bin/ls in particular that makes it worth risk
breaking on systems like this?

@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

If the patch is so simple, why don't you provide it?

@sjoerdmullender
Copy link
Member

Logged In: YES
user_id=43607

This bug report is related to [ bpo-460613 ] test_commands fails on SGI, which nobody ever seems to have noticed
and which is still open.
The problem there is that /bin/ls *does* exist, but is a symlink.

@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

OK, reopening.

@gvanrossum
Copy link
Member

Logged In: YES
user_id=6380

Assigned to Fred Drake, who wrote the test suite.

@prjsf
Copy link
Mannequin Author

prjsf mannequin commented Dec 31, 2001

Logged In: YES
user_id=412110

Sorry, I should have thought of providing a patch to begin
with.
<URL:http://multivac.cwru.edu./prj/python-test-commands.patch\>
This regexp test is weaker than the original one, but seems to
be still stronger than necessary. If ls is broken here, we
don't care, because it isn't part of Python. All wee need is
to be able to spawn a shell.

@prjsf
Copy link
Mannequin Author

prjsf mannequin commented Mar 26, 2002

Logged In: YES
user_id=412110

This problem still exists in 2.2.1c2. Is there something wrong
with my patch?

@mwhudson
Copy link

Logged In: YES
user_id=6656

No attempt was made to fix this for 2.2.1c2.

I didn't make fixing little bugs in the tests a priority,
sorry.

I don't think it's been fixed on the trunk.

@freddrake
Copy link
Member

Logged In: YES
user_id=3066

Checked in patch as provided in Lib/test/test_commands.py
revision 1.4; closed bug bpo-460613 as well.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

4 participants