solaris-ips icon indicating copy to clipboard operation
solaris-ips copied to clipboard

Traceback in cli.t_pkg_depotd.py TestPkgDepot.test_empty_incorp_depend

Open citrus-it opened this issue 7 years ago • 1 comments

Running the test-suite on Solaris 11.4, I see a test failure in TestPkgDepot.test_empty_incorp_depend which was not there before https://github.com/oracle/solaris-ips/commit/729c95dff6f40fc4b8dae84c8381c96db60cc8d1

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 avatar Sep 14 '18 11:09 citrus-it

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
----------------------------------------------------------------------

citrus-it avatar Sep 14 '18 11:09 citrus-it