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

Traceback in cli.t_pkg_depotd.py TestPkgDepot.test_empty_incorp_depend #1

Open
citrus-it opened this issue Sep 14, 2018 · 1 comment

Comments

@citrus-it
Copy link

citrus-it commented Sep 14, 2018

Running the test-suite on Solaris 11.4, I see a test failure in TestPkgDepot.test_empty_incorp_depend which was not there before 729c95d

The problem is in CatalogInterface.gen_allowed_packages() in that md.get("actions") always returns an empty set and so the loop's else: clause is entered without f ever having been assigned.

I fixed it with:

--- a/src/modules/server/api.py
+++ b/src/modules/server/api.py
@@ -159,11 +159,8 @@ class CatalogInterface(_Interface):
                         allowed.setdefault(pkg_name, [])
                         for v, entries in cat.entries_by_version(pkg_name,
                             info_needed=cat_info, pubs=pubs):
-                                for f, fa in (
-                                    (f, fa)
-                                    for f, md in entries
-                                    for fa in md.get("actions", misc.EmptyI)
-                                ):
+                                for f, md in entries:
+                                    for fa in md.get("actions", misc.EmptyI):
                                         if not fa.startswith("set"):
                                                 continue

@@ -180,7 +177,7 @@ class CatalogInterface(_Interface):
                                                 del a
                                                 break
                                         del a
-                                else:
+                                    else:
                                         allowed[pkg_name].append((f, sn))

                 sort_ver = itemgetter(0)

However, it does seem that there is a bigger problem here since I can't determine how the set actions that are being checked for could ever be returned with this test (same with the code before this latest commit).

@citrus-it
Copy link
Author

citrus-it commented Sep 14, 2018

ai01# uname -a
SunOS ai01 5.11 11.4.0.15.0 i86pc i386 i86pc

ai01# ./run.py -l -o test_empty_incorp_depend
Running tests on live system.
# logging to /tmp/tmpJsoem3.pkg-test.log



Tests in progress:
        0       7486    cli.t_pkg_depotd.py TestPkgDepot
Estimated time remaining 1 seconds



Finished cli.t_pkg_depotd.py TestPkgDepot in process 0
Total test classes:1 Finished test classes:1 Running tests:0
Total tests:1 Tests run:1 Errors:1 Failures:0 Skips:0

======================================================================
ERROR: cli.t_pkg_depotd.py TestPkgDepot.test_empty_incorp_depend
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./pkg5unittest.py", line 759, in run
    testMethod()
  File "./api/../cli/t_pkg_depotd.py", line 488, in test_empty_incorp_depend
    res = urlopen(repourl)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found

# ----------------------------------------------------------------------

# Ran 1 test in 2.134s - skipped 0 tests.

FAILED (successes=0, failures=0, errors=1, mismatches=1)

======================================================================
BASELINE MISMATCH: The following results didn't match the baseline.
----------------------------------------------------------------------
cli.t_pkg_depotd.py TestPkgDepot.test_empty_incorp_depend: error
----------------------------------------------------------------------

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