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

setUp method in testPolicy test case doesn't catch pipe errors #49

Open
Whissi opened this issue Jan 26, 2022 · 0 comments
Open

setUp method in testPolicy test case doesn't catch pipe errors #49

Whissi opened this issue Jan 26, 2022 · 0 comments

Comments

@Whissi
Copy link

Whissi commented Jan 26, 2022

I run into the following test failure:

======================================================================
ERROR: testPolicy (testpolicy.PolicyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pymilter-1.0.5/work/pymilter-pymilter-1.0.5/testpolicy.py", line 26, in testPolicy
    with MTAPolicy('[email protected]',conf=self.config) as p:
  File "/var/tmp/portage/dev-python/pymilter-1.0.5/work/pymilter-pymilter-1.0.5/Milter/policy.py", line 43, in __enter__
    self.acf = dbmopen(self.access_file,'r')
  File "/var/tmp/portage/dev-python/pymilter-1.0.5/work/pymilter-pymilter-1.0.5/Milter/policy.py", line 17, in dbmopen
    f.open(fname,mode)
  File "/var/tmp/portage/dev-python/pymilter-1.0.5/work/pymilter-pymilter-1.0.5/Milter/policy.py", line 8, in open
    self.f.open(fname,flags=flags)
bsddb3.db.DBNoSuchFileError: (2, 'No such file or directory')                                                           

That's because I had no makemap command available on the box where I run this test. I think

pymilter/testpolicy.py

Lines 19 to 21 in 7deec90

cmd = 'tr : ! <test/access | makemap hash test/access.db'
if os.system(cmd):
print('failed!')
is invalid because it won't catch pipe errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant