From ce5359f54ce0c2c74ddb198c87591796c0c70329 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 15 Feb 2022 12:31:20 -0600 Subject: [PATCH 1/4] Fix images since/after tests For the since and after imagve filter tests, instead of using the read-only cache of images, we just use the empty r/w store. We then build three images that are strictly predictable. Signed-off-by: Brent Baude --- test/e2e/images_test.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index 3a9f3f513a..5492860b3d 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -188,23 +188,27 @@ WORKDIR /test }) It("podman images filter since image", func() { - dockerfile := `FROM quay.io/libpod/alpine:latest + dockerfile := `FROM scratch ` - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") - result := podmanTest.Podman([]string{"images", "-q", "-f", "since=quay.io/libpod/alpine:latest"}) + podmanTest.BuildImage(dockerfile, "foobar.com/one:latest", "false") + podmanTest.BuildImage(dockerfile, "foobar.com/two:latest", "false") + podmanTest.BuildImage(dockerfile, "foobar.com/three:latest", "false") + result := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "since=foobar.com/one:latest"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray())).To(Equal(9)) + Expect(result.OutputToStringArray()).To(HaveLen(2)) }) It("podman image list filter after image", func() { - dockerfile := `FROM quay.io/libpod/alpine:latest + dockerfile := `FROM scratch ` - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") - result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=quay.io/libpod/alpine:latest"}) + podmanTest.BuildImage(dockerfile, "foobar.com/one:latest", "false") + podmanTest.BuildImage(dockerfile, "foobar.com/two:latest", "false") + podmanTest.BuildImage(dockerfile, "foobar.com/three:latest", "false") + result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=foobar.com/one:latest"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(result.OutputToStringArray()).Should(HaveLen(9), "list filter output: %q", result.OutputToString()) + Expect(result.OutputToStringArray()).Should(HaveLen(2), "list filter output: %q", result.OutputToString()) }) It("podman images filter dangling", func() { From 2fd1ff9d1e49ed7105ab4cb2ccfe0cf9a9fcf98b Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 15 Feb 2022 15:21:00 -0600 Subject: [PATCH 2/4] Changes of docker descriptions It looks like some descriptions have changed on the docker registry where we had been searching for images that include 'alpine'. We are now seeing an image in the initial list that has 'alpine' in its description. Signed-off-by: Brent Baude --- test/python/docker/compat/test_images.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/python/docker/compat/test_images.py b/test/python/docker/compat/test_images.py index 1e2b531b7d..4b1620faa8 100644 --- a/test/python/docker/compat/test_images.py +++ b/test/python/docker/compat/test_images.py @@ -86,7 +86,8 @@ def test_list_images(self): def test_search_image(self): """Search for image""" for r in self.client.images.search("alpine"): - self.assertIn("alpine", r["Name"]) + # registry matches if string is in either one + self.assertIn("alpine", r["Name"]+" "+r["Description"].lower()) def test_search_bogus_image(self): """Search for bogus image should throw exception""" From e906e9cd37dfa2550cec1a4baf1dfc1cd2b911bb Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 15 Feb 2022 15:23:44 -0700 Subject: [PATCH 3/4] [CI:DOCS] logformatter: handle python logs We've got some python tests running in CI, and they're really hard to troubleshoot. This PR: 1) colorizes python unittest lines (ok / skipped / fail), and 2) links to source files The color is nice for skimming, but it's the linking that might make it much easier to diagnose future failures. (Context: failure today in test/python/docker/compat/test_images.py) Signed-off-by: Ed Santiago --- contrib/cirrus/logformatter | 104 ++++++++++++--- contrib/cirrus/logformatter.t | 236 +++++++++++++++++++++++++++++++--- 2 files changed, 308 insertions(+), 32 deletions(-) diff --git a/contrib/cirrus/logformatter b/contrib/cirrus/logformatter index 5156f9f8a4..43173eaa64 100755 --- a/contrib/cirrus/logformatter +++ b/contrib/cirrus/logformatter @@ -37,12 +37,15 @@ table.synopsis { border: none; border-collapse: collapse; margin-left: 2em; marg .synopsis td { font-weight: bold; font-size: 120%; font-family: monospace; } /* test results */ +.testname { font-size: 125%; color: #444; } .boring { color: #999; } .timestamp { color: #999; } .log-debug { color: #999; } .log-info { color: #333; } .log-warn { color: #f60; } .log-error { color: #900; font-weight: bold; } +.log-skip { color: #F90; } +.log-slow { background: #FF0; color: #000; font-weight: bold; } .subtest { background: #eee; } .subsubtest { color: #F39; font-weight: bold; } .string { color: #00c; } @@ -184,14 +187,6 @@ END_HTML print { $out_fh } "

Synopsis

\n
\n", job_synopsis($test_name), "
\n"; - # FOR DEBUGGING: dump environment, but in HTML comments to not clutter - print { $out_fh } "\n"; - for my $e (sort keys %ENV) { - my $val = escapeHTML($ENV{$e}); - $val =~ s/--/--/g; # double dash not valid in comments - printf { $out_fh } "\n", $e, $val; - } - # State variables my $previous_timestamp = ''; # timestamp of previous line my $cirrus_task; # Cirrus task number, used for linking @@ -201,15 +196,25 @@ END_HTML my $after_divider = 0; # Count of lines after seeing '-----' my $current_output; # for removing duplication my $looks_like_bats; # binary flag: for detecting BATS results + my $looks_like_python; # " " " : for colorizing python tests my %bats_count; # For summary line: count of pass/fail/skip + # When running in cirrus, we have the commit SHA + $git_commit = $ENV{CIRRUS_CHANGE_IN_REPO}; + print { $out_fh } "
 \n";
 
+    # Assume rootful prompt, check for rootless (here and in log itself, below)
+    my $Prompt = '#';
+    $Prompt = '$' if $test_name =~ /rootless/;
+
     # Main loop: read input, one line at a time, and write out reformatted
   LINE:
     while (my $line = ) {
         print $line;                    # Immediately dump back to stdout
 
+        $Prompt = '$' if $line =~ /Runner executing .* as rootless /;
+
         # Remain robust in face of errors: always write stdout even if no HTML
         next LINE if ! $out_fh;
 
@@ -236,6 +241,11 @@ END_HTML
             #           1  12  3                 34     4 5   526  6
             $line =~ s{^(.*)(\/(containers\/[^/]+)(\/\S+):(\d+))(.*)$}
                       {$1$2$6};
+
+            # Same, for python errors
+            #           1  12  3                 34         4             5   526
+            $line =~ s{^(.*)(\/(containers\/[^/]+)(\/\S+\.py).*,\s+line\s+(\d+))(,\s+in.*)$}
+                      {$1$2$6};
         }
 
         # Try to identify the cirrus task
@@ -247,13 +257,42 @@ END_HTML
         if ($line =~ /^1\.\.(\d+)$/) {
             $looks_like_bats = 1;
             $bats_count{expected_total} = $1;
+            undef $looks_like_python;
         }
         # Since the number of tests can't always be predicted, recognize
         # some leading text strings that indicate BATS output to come.
         elsif ($line =~ /^TAP\s+version\s/ || $line =~ m!/test-apiv2!) {
             $looks_like_bats = 1;
             $bats_count{expected_total} = -1; # Expect to be overridden at end!
+            undef $looks_like_python;
         }
+
+        # 'python -m unittest' means we're starting some pythony stuff
+        elsif ($line =~ m!/python.*\sunittest\s!) {
+            $looks_like_python = 1;
+            undef $looks_like_bats;
+        }
+        elsif ($looks_like_python && $line =~ m!Ran\s+(\d+)\s+tests\s+in\s!) {
+            # End of python tests. However, we're still likely to see a
+            # summary line saying 'OK' or 'FAILED'. Deal with that by
+            # resetting $looks_like_python to 0, which the next elsif catches
+            $bats_count{expected_total} += $1;
+            $looks_like_python = 0;
+            print { $out_fh } "\n"            if $in_failure;
+            undef $in_failure;
+        }
+        elsif (defined($looks_like_python) && !$looks_like_python) {
+            # The final python summary line. Show it in its appropriate color.
+            if ($line =~ /^\s*(OK|FAILED)\s+\(/) {
+                undef $looks_like_python;
+                my $css = ($1 eq 'OK' ? 'passed' : 'failed');
+                print { $out_fh } "$timestamp"
+                    if $timestamp;
+                print { $out_fh } "", $line, "\n";
+                next LINE;
+            }
+        }
+
         if ($looks_like_bats) {
             my $css;
 
@@ -283,6 +322,28 @@ END_HTML
             print { $out_fh } $line, "\n";
             next LINE;
         }
+        elsif ($looks_like_python) {
+            my $css;
+
+            if    ($line =~ /\s\.\.\.\sskipped/) { $css = 'skipped' }
+            elsif ($line =~ /\s\.\.\.\sok\s*$/)  { $css = 'passed'  }
+            elsif ($line =~ /\s\.\.\.\sFAIL/)    { $css = 'failed'  }
+            elsif ($line =~ /^\s*={40}/)         {
+                # Begins a block of multiple lines including a stack trace
+                print { $out_fh } "
\n" unless $in_failure; + $in_failure = 1; + } + + if ($css) { + $line = "$line"; + + $bats_count{$css}++; + } + print { $out_fh } "$timestamp" + if $timestamp; + print { $out_fh } $line, "\n"; + next LINE; + } # Timing section at the bottom of the page if ($line =~ / timing results\s*$/) { @@ -328,11 +389,11 @@ END_HTML next LINE; } # (bindings test sometimes emits 'Running' with leading bullet char) - elsif ($line =~ /^•?Running:/) { + elsif ($line =~ s!^•?Running:!$Prompt!) { # Highlight the important (non-boilerplate) podman command. $line =~ s/\s+--remote\s+/ /g; # --remote takes no args # Strip out the global podman options, but show them on hover - $line =~ s{(\S+\/podman(-remote)?)((\s+--(root|runroot|runtime|tmpdir|storage-opt|conmon|cgroup-manager|cni-config-dir|storage-driver|events-backend|url) \S+)*)(.*)}{ + $line =~ s{(\S+\/podman(-remote)?)((\s+--(root|runroot|runtime|tmpdir|storage-opt|conmon|cgroup-manager|network-config-dir|storage-driver|events-backend|url) \S+)*)(.*)}{ my ($full_path, $remote, $options, $args) = ($1, $2||'', $3, $6); $options =~ s/^\s+//; @@ -365,19 +426,27 @@ END_HTML # an anchor so we can link to it later. if ($after_divider++ == 2) { # Sigh. There is no actual marker. Assume that anything with - ## two leading spaces then alpha (not slashes) is a test name. - if ($line =~ /^ [a-zA-Z]/) { + ## two leading spaces then alpha or hyphen (not slashes) is + ## a test name. + if ($line =~ /^ [a-zA-Z-]/) { my $id = make_id($line, 'anchor'); $line = "

$line

"; } } + # Make SKIPPING and SLOW TEST visible + $line =~ s!(\[SKIPPING\].*)!$1!; + $line =~ s!(\[SLOW TEST.*\])!$1!; + + # Highlight test name when it appears in the middle of commands. + # But make it boring, because we already have the test name in large + # bold just above. (Except in skipped tests). + $line =~ s!^(\s*)(\[It\]\s+.*)!$1$2!; + # Failure name corresponds to a previously-seen block. - ## FIXME: sometimes there are three failures with the same name. - ## ...I have no idea why or how to link to the right ones. - # 1 2 2 3 3 14 4 - if ($line =~ /^(\[(Fail|Panic!)\] .* \[(It|BeforeEach)\] )([A-Za-z].*)/) { + # 1 2 2 3 3 14 4 + if ($line =~ /^(\[(Fail|Panic!)\] .* \[(It|BeforeEach)\] )([A-Za-z-].*)/) { my ($lhs, $type, $ginkgo_fluff, $testname) = ($1, $2, $3, $4); my $id = make_id($testname, 'link'); @@ -486,7 +555,10 @@ sub make_id { state %counter; $name =~ s/^\s+|\s+$//g; # strip leading/trailing whitespace + $name =~ s/\&#\d+;//g; # 'doesn't' -> 'doesnt' + $name =~ s/\"/-/g; # '"path"' -> '-path-' $name =~ s/[^a-zA-Z0-9_-]/-/g; # Convert non-alphanumeric to dash + $name =~ s/-{3,}/-/g; # '------' to just '-' # Keep a running tally of how many times we've seen this identifier # for this given type! This lets us cross-match, in the bottom of diff --git a/contrib/cirrus/logformatter.t b/contrib/cirrus/logformatter.t index bd4179b5ec..df8154cb9d 100755 --- a/contrib/cirrus/logformatter.t +++ b/contrib/cirrus/logformatter.t @@ -12,6 +12,9 @@ use FindBin; use File::Temp qw(tempdir); use Test::More; +# To test links to source files +$ENV{CIRRUS_CHANGE_IN_REPO} = 'ceci-nest-pas-une-sha'; + # # Read the test cases (see __END__ section below) # @@ -122,21 +125,47 @@ $SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP} [+0103s] /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:18 [+0103s] [It] podman pod restart single empty pod [+0103s] /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:41 -[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --cni-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod create --infra=false --share +[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --network-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod create --infra=false --share [+0103s] 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 [+0103s] output: 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 -[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --cni-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod restart 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 +[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --network-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod restart 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 [+0103s] Error: no containers in pod 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 have no dependencies, cannot start pod: no such container [+0103s] output: [+0103s] [AfterEach] Podman pod restart [+0103s] /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:28 -[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --cni-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod rm -fa +[+0103s] Running: /var/tmp/go/src/github.com/containers/podman/bin/podman --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --network-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs pod rm -fa [+0103s] 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 -[+0104s] Running: /var/tmp/go/src/github.com/containers/libpod/bin/podman-remote --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --cni-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs --remote --url unix:/run/user/12345/podman-xyz.sock pod rm -fa +[+0104s] Running: /var/tmp/go/src/github.com/containers/libpod/bin/podman-remote --storage-opt vfs.imagestore=/tmp/podman/imagecachedir --root /tmp/podman_test553496330/crio --runroot /tmp/podman_test553496330/crio-run --runtime /usr/bin/runc --conmon /usr/bin/conmon --network-config-dir /etc/cni/net.d --cgroup-manager systemd --tmpdir /tmp/podman_test553496330 --events-backend file --storage-driver vfs --remote --url unix:/run/user/12345/podman-xyz.sock pod rm -fa [+0104s] 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 again + + [+0107s] • -[+0107s] ------------------------------ -[+0107s] podman system reset +[+0523s] ------------------------------ +[+0523s] Podman play kube with build +[+0523s] --build should override image in store +[+0523s] /var/tmp/go/src/github.com/containers/podman/test/e2e/play_build_test.go:215 + + +[+0479s] • +[+0479s] ------------------------------ +[+0479s] Podman pod rm +[+0479s] podman pod rm -a doesn't remove a running container +[+0479s] /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_rm_test.go:119 + + +[+1405s] • +[+1405s] ------------------------------ +[+1405s] Podman run entrypoint +[+1405s] podman run entrypoint == [""] +[+1405s] /var/tmp/go/src/github.com/containers/podman/test/e2e/run_entrypoint_test.go:47 + +[+0184s] S [SKIPPING] [3.086 seconds] +[+1385s] S [SKIPPING] in Spec Setup (BeforeEach) [0.001 seconds] + +[+1512s] Summarizing 6 Failures: +[+1512s] +[+1512s] [Fail] Podman play kube with build [It] --build should override image in store +[+1512s] /var/tmp/go/src/github.com/containers/podman/test/e2e/play_build_test.go:259 >>> $SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP} [08:26:19] START - All [+xxxx] lines that follow are relative to right now. @@ -150,25 +179,25 @@ $SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP} /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:41 [BeforeEach] Podman pod restart /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:18 - [It] podman pod restart single empty pod + [It] podman pod restart single empty pod /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:41 - Running: podman # podman [options] pod create --infra=false --share 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 - Running: podman # podman output: [AfterEach] Podman pod restart /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_restart_test.go:28 - Running: podman # podman [options] pod rm -fa 4810be0cfbd42241e349dbe7d50fbc54405cd320a6637c65fd5323f34d64af89 -[+0104s] Running: podman-remote [+0104s] # podman-remote [+0107s] podman system reset +[+0523s] Podman play kube with build +

--build should override image in store

+ /var/tmp/go/src/github.com/containers/podman/test/e2e/play_build_test.go:215 + + +[+0479s] • +
+
+
+[+0479s] Podman pod rm
+         

podman pod rm -a doesn't remove a running container

+ /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_rm_test.go:119 + + +[+1405s] • +
+
+
+[+1405s] Podman run entrypoint
+         

podman run entrypoint == [""]

+ /var/tmp/go/src/github.com/containers/podman/test/e2e/run_entrypoint_test.go:47 + + +[+0184s] S [SKIPPING] [3.086 seconds] +[+1385s] S [SKIPPING] in Spec Setup (BeforeEach) [0.001 seconds] + + +[+1512s] Summarizing 6 Failures: +[+1512s] + [Fail] Podman play kube with build [It] --build should override image in store + /var/tmp/go/src/github.com/containers/podman/test/e2e/play_build_test.go:259 + + +== simple python + +<<< +[+0234s] env CONTAINERS_CONF=/var/tmp/go/src/github.com/containers/podman/test/apiv2/containers.conf PODMAN=./bin/podman /usr/bin/python3 -m unittest discover -v ./test/python/docker +[+0238s] test_copy_to_container (compat.test_containers.TestContainers) ... /usr/lib/python3.10/site-packages/docker/utils/utils.py:269: DeprecationWarning: urllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() instead +[+0238s] host, port = splitnport(parsed_url.netloc) +[+0241s] ok +[+0243s] test_create_container (compat.test_containers.TestContainers) ... ok +[+0244s] test_create_network (compat.test_containers.TestContainers) ... ok +[+0245s] test_filters (compat.test_containers.TestContainers) ... skipped 'TODO Endpoint does not yet support filters' +[+0246s] test_kill_container (compat.test_containers.TestContainers) ... /usr/lib64/python3.10/threading.py:372: ResourceWarning: unclosed +[+0246s] waiters_to_notify = _deque(_islice(all_waiters, n)) +[+0246s] ResourceWarning: Enable tracemalloc to get the object allocation traceback +[+0247s] ok +[+0248s] test_list_container (compat.test_containers.TestContainers) ... ok +[+0252s] test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok +[+0253s] test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok +[+0257s] test_non_existant_workdir (compat.test_containers.TestContainers) ... ok +[+0258s] test_pause_container (compat.test_containers.TestContainers) ... ok +[+0260s] test_pause_stopped_container (compat.test_containers.TestContainers) ... ok +[+0261s] test_remove_container (compat.test_containers.TestContainers) ... ok +[+0262s] test_remove_container_without_force (compat.test_containers.TestContainers) ... /usr/lib64/python3.10/email/feedparser.py:89: ResourceWarning: unclosed +[+0262s] for ateof in reversed(self._eofstack): +[+0262s] ResourceWarning: Enable tracemalloc to get the object allocation traceback +[+0262s] /usr/lib64/python3.10/email/feedparser.py:89: ResourceWarning: unclosed +[+0262s] for ateof in reversed(self._eofstack): +[+0262s] ResourceWarning: Enable tracemalloc to get the object allocation traceback +[+0262s] ok +[+0264s] test_restart_container (compat.test_containers.TestContainers) ... ok +[+0265s] test_start_container (compat.test_containers.TestContainers) ... ok +[+0267s] test_start_container_with_random_port_bind (compat.test_containers.TestContainers) ... ok +[+0268s] test_stop_container (compat.test_containers.TestContainers) ... ok +[+0269s] test_unpause_container (compat.test_containers.TestContainers) ... ok +[+0273s] test_build_image (compat.test_images.TestImages) ... ok +[+0273s] test_get_image_exists_not (compat.test_images.TestImages) +[+0274s] Negative test for get image ... ok +[+0274s] test_image_history (compat.test_images.TestImages) +[+0274s] Image history ... ok +[+0274s] test_list_images (compat.test_images.TestImages) +[+0276s] List images ... ok +[+0276s] test_load_corrupt_image (compat.test_images.TestImages) +[+0277s] Import|Load Image failure ... ok +[+0277s] test_load_image (compat.test_images.TestImages) +[+0279s] Import|Load Image ... ok +[+0279s] test_remove_image (compat.test_images.TestImages) +[+0280s] Remove image ... ok +[+0280s] test_retag_valid_image (compat.test_images.TestImages) +[+0280s] Validates if name updates when the image is retagged ... ok +[+0280s] test_save_image (compat.test_images.TestImages) +[+0282s] Export Image ... ok +[+0282s] test_search_bogus_image (compat.test_images.TestImages) +[+0290s] Search for bogus image should throw exception ... ok +[+0290s] test_search_image (compat.test_images.TestImages) +[+0291s] Search for image ... FAIL +[+0291s] test_tag_valid_image (compat.test_images.TestImages) +[+0292s] Validates if the image is tagged successfully ... ok +[+0296s] test_Info (compat.test_system.TestSystem) ... ok +[+0298s] test_info_container_details (compat.test_system.TestSystem) ... ok +[+0299s] test_version (compat.test_system.TestSystem) ... ok +[+0299s] ====================================================================== +[+0299s] FAIL: test_search_image (compat.test_images.TestImages) +[+0299s] Search for image +[+0299s] ---------------------------------------------------------------------- +[+0299s] Traceback (most recent call last): +[+0299s] File "/var/tmp/go/src/github.com/containers/podman/test/python/docker/compat/test_images.py", line 90, in test_search_image +[+0299s] self.assertIn("alpine", r["Name"]) +[+0299s] AssertionError: 'alpine' not found in 'docker.io/docker/desktop-kubernetes' +[+0299s] ---------------------------------------------------------------------- +[+0299s] Ran 33 tests in 63.138s +[+0299s] FAILED (failures=1, skipped=1) +[+0299s] make: *** [Makefile:616: localapiv2] Error 1 +>>> +[+0234s] env CONTAINERS_CONF=/var/tmp/go/src/github.com/containers/podman/test/apiv2/containers.conf PODMAN=./bin/podman /usr/bin/python3 -m unittest discover -v ./test/python/docker +[+0238s] test_copy_to_container (compat.test_containers.TestContainers) ... /usr/lib/python3.10/site-packages/docker/utils/utils.py:269: DeprecationWarning: urllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() instead + host, port = splitnport(parsed_url.netloc) +[+0241s] ok +[+0243s] test_create_container (compat.test_containers.TestContainers) ... ok +[+0244s] test_create_network (compat.test_containers.TestContainers) ... ok +[+0245s] test_filters (compat.test_containers.TestContainers) ... skipped 'TODO Endpoint does not yet support filters' +[+0246s] test_kill_container (compat.test_containers.TestContainers) ... /usr/lib64/python3.10/threading.py:372: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 55054), raddr=('127.0.0.1', 8080)> + waiters_to_notify = _deque(_islice(all_waiters, n)) + ResourceWarning: Enable tracemalloc to get the object allocation traceback +[+0247s] ok +[+0248s] test_list_container (compat.test_containers.TestContainers) ... ok +[+0252s] test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok +[+0253s] test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok +[+0257s] test_non_existant_workdir (compat.test_containers.TestContainers) ... ok +[+0258s] test_pause_container (compat.test_containers.TestContainers) ... ok +[+0260s] test_pause_stopped_container (compat.test_containers.TestContainers) ... ok +[+0261s] test_remove_container (compat.test_containers.TestContainers) ... ok +[+0262s] test_remove_container_without_force (compat.test_containers.TestContainers) ... /usr/lib64/python3.10/email/feedparser.py:89: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 55068), raddr=('127.0.0.1', 8080)> + for ateof in reversed(self._eofstack): + ResourceWarning: Enable tracemalloc to get the object allocation traceback + /usr/lib64/python3.10/email/feedparser.py:89: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 55074), raddr=('127.0.0.1', 8080)> + for ateof in reversed(self._eofstack): + ResourceWarning: Enable tracemalloc to get the object allocation traceback + ok +[+0264s] test_restart_container (compat.test_containers.TestContainers) ... ok +[+0265s] test_start_container (compat.test_containers.TestContainers) ... ok +[+0267s] test_start_container_with_random_port_bind (compat.test_containers.TestContainers) ... ok +[+0268s] test_stop_container (compat.test_containers.TestContainers) ... ok +[+0269s] test_unpause_container (compat.test_containers.TestContainers) ... ok +[+0273s] test_build_image (compat.test_images.TestImages) ... ok + test_get_image_exists_not (compat.test_images.TestImages) +[+0274s] Negative test for get image ... ok + test_image_history (compat.test_images.TestImages) + Image history ... ok + test_list_images (compat.test_images.TestImages) +[+0276s] List images ... ok + test_load_corrupt_image (compat.test_images.TestImages) +[+0277s] Import|Load Image failure ... ok + test_load_image (compat.test_images.TestImages) +[+0279s] Import|Load Image ... ok + test_remove_image (compat.test_images.TestImages) +[+0280s] Remove image ... ok + test_retag_valid_image (compat.test_images.TestImages) + Validates if name updates when the image is retagged ... ok + test_save_image (compat.test_images.TestImages) +[+0282s] Export Image ... ok + test_search_bogus_image (compat.test_images.TestImages) +[+0290s] Search for bogus image should throw exception ... ok + test_search_image (compat.test_images.TestImages) +[+0291s] Search for image ... FAIL + test_tag_valid_image (compat.test_images.TestImages) +[+0292s] Validates if the image is tagged successfully ... ok +[+0296s] test_Info (compat.test_system.TestSystem) ... ok +[+0298s] test_info_container_details (compat.test_system.TestSystem) ... ok +[+0299s] test_version (compat.test_system.TestSystem) ... ok +
+ ====================================================================== + FAIL: test_search_image (compat.test_images.TestImages) + Search for image + ---------------------------------------------------------------------- + Traceback (most recent call last): + File "/var/tmp/go/src/github.com/containers/podman/test/python/docker/compat/test_images.py", line 90, in test_search_image + self.assertIn("alpine", r["Name"]) + AssertionError: 'alpine' not found in 'docker.io/docker/desktop-kubernetes' + ---------------------------------------------------------------------- +
+ Ran 33 tests in 63.138s + FAILED (failures=1, skipped=1) + make: *** [Makefile:616: localapiv2] Error 1 +
Summary: 28 Passed, 1 Failed, 1 Skipped. Total tests: 30 (WARNING: expected 33) From 4fa7a2e3ae64b2b5d3f0fefd82fa1b6905e66f87 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Mon, 21 Feb 2022 10:54:04 -0500 Subject: [PATCH 4/4] Disable search-images test Found images being returned which do have "Alpine" in the description. However, test fails because podman truncates the field. Disabling test since this is a long-term maintenance branch. Signed-off-by: Chris Evich --- test/python/docker/compat/test_images.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/python/docker/compat/test_images.py b/test/python/docker/compat/test_images.py index 4b1620faa8..cb3f84ceca 100644 --- a/test/python/docker/compat/test_images.py +++ b/test/python/docker/compat/test_images.py @@ -83,11 +83,14 @@ def test_list_images(self): # List images with filter self.assertEqual(len(self.client.images.list(filters={"reference": "alpine"})), 1) - def test_search_image(self): - """Search for image""" - for r in self.client.images.search("alpine"): - # registry matches if string is in either one - self.assertIn("alpine", r["Name"]+" "+r["Description"].lower()) + # Disabled due to dependence on potentially unstable search results and + # failures because podman truncates image descriptions which otherwise + # would satisfy test condition. + #def test_search_image(self): + # """Search for image""" + # for r in self.client.images.search("alpine"): + # # registry matches if string is in either one + # self.assertIn("alpine", r["Name"]+" "+r["Description"].lower()) def test_search_bogus_image(self): """Search for bogus image should throw exception"""