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

New system connection add test #24340

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

l0rd
Copy link
Member

@l0rd l0rd commented Oct 22, 2024

⚠️ This PR is a draft as it uses my containers/common fork (until containers/common#2212 get merged)

The changes included:

❯ ./test/tools/build/ginkgo -vv  --tags "systemd libsubid exclude_graphdriver_devicemapper seccomp  remote" -timeout=90m --flake-attempts 0 \
        --trace  \
        -p \
        --focus "sshd and API services required" --silence-skips \
        --focus-file "system_connection_test.go" --silence-skips test/e2e/.
Running Suite: Libpod Suite - /home/mariolet/github/podman/test/e2e
===================================================================
Random Seed: 1729869028

Will run 6 of 2279 specs
Running in parallel across 2 processes
------------------------------
[SynchronizedBeforeSuite] PASSED [5.330 seconds]
[SynchronizedBeforeSuite]
/home/mariolet/github/podman/test/e2e/common_test.go:158

  Timeline >>
  > Enter [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:36.317
  [image already cached: /var/tmp/quay.io-libpod-cirros-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-volume-plugin-test-img-20220623.tar]
  [image already cached: /var/tmp/quay.io-libpod-alpine-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-busybox-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-alpine_nginx-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-redis-alpine.tar]
  [image already cached: /var/tmp/quay.io-libpod-registry-2.8.2.tar]
  [image already cached: /var/tmp/quay.io-libpod-k8s-pause-3.5.tar]
  [image already cached: /var/tmp/quay.io-libpod-testimage-20241011.tar]
  [image already cached: /var/tmp/quay.io-libpod-alpine_healthcheck-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-systemd-image-20240124.tar]
  Restoring quay.io/libpod/alpine:latest...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-alpine-latest.tar
  Loaded image: quay.io/libpod/alpine:latest
  Restoring quay.io/libpod/busybox:latest...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-busybox-latest.tar
  Loaded image: quay.io/libpod/busybox:latest
  Restoring quay.io/libpod/alpine_nginx:latest...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-alpine_nginx-latest.tar
  Loaded image: quay.io/libpod/alpine_nginx:latest
  Restoring quay.io/libpod/redis:alpine...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-redis-alpine.tar
  Loaded image: quay.io/libpod/redis:alpine
  Restoring quay.io/libpod/registry:2.8.2...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-registry-2.8.2.tar
  Loaded image: quay.io/libpod/registry:2.8.2
  Restoring quay.io/libpod/k8s-pause:3.5...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-k8s-pause-3.5.tar
  Loaded image: quay.io/libpod/k8s-pause:3.5
  Restoring quay.io/libpod/testimage:20241011...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-testimage-20241011.tar
  Loaded image: quay.io/libpod/testimage:20241011
  Restoring quay.io/libpod/alpine_healthcheck:latest...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-alpine_healthcheck-latest.tar
  Loaded image: quay.io/libpod/alpine_healthcheck:latest
  Restoring quay.io/libpod/systemd-image:20240124...
  Running: /home/mariolet/github/podman/bin/podman --root /tmp/podman-e2e-2281833054/imagecachedir --runroot /tmp/podman-e2e-2281833054/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/image-init/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/image-init --events-backend none --db-backend sqlite --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-systemd-image-20240124.tar
  Loaded image: quay.io/libpod/systemd-image:20240124
  -----------------------------
  < Exit [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:41.646 (5.329s)
  > Enter [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:41.647
  < Exit [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:41.647 (0s)
  << Timeline
------------------------------
[SynchronizedBeforeSuite] PASSED [5.333 seconds]
[SynchronizedBeforeSuite]
/home/mariolet/github/podman/test/e2e/common_test.go:158

  Timeline >>
  > Enter [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:41.653
  < Exit [SynchronizedBeforeSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:158 @ 10/25/24 15:10:41.653 (0s)
  << Timeline
------------------------------
• [1.192 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// socket path using connection heuristic
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:457

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:41.751
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:41.752 (1ms)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:41.753
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:41.753 (0s)
  > Enter [BeforeAll] sshd and API services required - /home/mariolet/github/podman/test/e2e/system_connection_test.go:433 @ 10/25/24 15:10:41.753
  active
  < Exit [BeforeAll] sshd and API services required - /home/mariolet/github/podman/test/e2e/system_connection_test.go:433 @ 10/25/24 15:10:41.789 (36ms)
  > Enter [It] add ssh:// socket path using connection heuristic - /home/mariolet/github/podman/test/e2e/system_connection_test.go:457 @ 10/25/24 15:10:41.789
  QA ssh://mariolet@localhost:22/run/user/1000/podman/podman.sock /home/mariolet/.ssh/id_ed25519 true true
  < Exit [It] add ssh:// socket path using connection heuristic - /home/mariolet/github/podman/test/e2e/system_connection_test.go:457 @ 10/25/24 15:10:42.659 (870ms)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:42.66
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-747096499/root --runroot /tmp/podman-e2e-2281833054/subtest-747096499/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-747096499/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-747096499 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
  Error: unable to connect to Podman socket: failed to connect: ssh: handshake failed: EOF
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-747096499/root --runroot /tmp/podman-e2e-2281833054/subtest-747096499/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-747096499/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-747096499 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-747096499/root --runroot /tmp/podman-e2e-2281833054/subtest-747096499/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-747096499/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-747096499 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:42.943 (283ms)
  << Timeline
------------------------------
• [0.864 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// with known_hosts
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:509
      ->
      /home/mariolet/github/podman/test/e2e/system_connection_test.go:537
        with a public key of the SSH server that matches the SSH server first key
        /home/mariolet/github/podman/test/e2e/system_connection_test.go:590

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:42.945
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:42.945 (0s)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:42.945
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:42.946 (0s)
  > Enter [BeforeAll] add ssh:// with known_hosts - /home/mariolet/github/podman/test/e2e/system_connection_test.go:515 @ 10/25/24 15:10:42.946
  # localhost:22 SSH-2.0-OpenSSH_9.6
  # localhost:22 SSH-2.0-OpenSSH_9.6
  # localhost:22 SSH-2.0-OpenSSH_9.6
  # localhost:22 SSH-2.0-OpenSSH_9.6
  # localhost:22 SSH-2.0-OpenSSH_9.6
  localhost ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCwQFQvjD0Tmb3TI5x9RwUiQVKJj4J4dZV8OVSA/EZMMh1s51lNlePBWu4F4s2GGpM3YGu1kkSXVKB9CPtpc+LbcPHtZsU0Wck2LFzVnc21fZ5xRkjbULeWLBuRrysW8FL8bh4IN2mlldpgohK5e9cJGIp0IykOSq0P64bYDtsj2rNtE73n9vLawkscJ+iIBjRsD4OEQCNOptFRpZXw2kSxYFuaGRaJfBKE1Kbj8yGTw1duDsMhlnXUBCHwsbh6iCLv7tmvcBwGfve+wcFIktUYLIfShKJ0uOqmJ17mUlmZnUYV1vq1siA4GZzUDmm1WdCVNlViFGtrcXaIr7lQefxH8PpynrT5LeJFblhivzJkqQFSPqTTIaIjSU8w+wArXoQ/+ld+zklu62t+r6dHR3LLmngeehnFMfCdfUEO6xihSSnqPA0f4zyjUEccHaCViUjtwWwqEWun4ZHZf+gR3eNYk2L1bVwBuHbza2uk1v65UzTzd/jycKOfyLggQjVPUoc=
  localhost ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAMX+Qbv4kfLJ8Z+hzwXmn5rl1gR1mnI/ySce92GyOGxcBHo5e/lfoSUUq9tQ3yoc7JgISL56vEVCBgqyjzu0yA=
  localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHPAJ0CX01iuX/dDxXThvdBN/vkWTpNhqEhyi9rWKkz
  < Exit [BeforeAll] add ssh:// with known_hosts - /home/mariolet/github/podman/test/e2e/system_connection_test.go:515 @ 10/25/24 15:10:43.061 (115ms)
  > Enter [It] with a public key of the SSH server that matches the SSH server first key - /home/mariolet/github/podman/test/e2e/system_connection_test.go:590 @ 10/25/24 15:10:43.061
  CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
  < Exit [It] with a public key of the SSH server that matches the SSH server first key - /home/mariolet/github/podman/test/e2e/system_connection_test.go:590 @ 10/25/24 15:10:43.594 (533ms)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:43.594
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1855305720/root --runroot /tmp/podman-e2e-2281833054/subtest-1855305720/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1855305720/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1855305720 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1855305720/root --runroot /tmp/podman-e2e-2281833054/subtest-1855305720/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1855305720/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1855305720 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1855305720/root --runroot /tmp/podman-e2e-2281833054/subtest-1855305720/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1855305720/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1855305720 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:43.809 (214ms)
  << Timeline
------------------------------
• [0.714 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// with known_hosts
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:509
      ->
      /home/mariolet/github/podman/test/e2e/system_connection_test.go:537
        with a public key of the SSH server that matches SSH server second key
        /home/mariolet/github/podman/test/e2e/system_connection_test.go:596

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:43.81
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:43.81 (0s)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:43.81
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:43.81 (0s)
  > Enter [It] with a public key of the SSH server that matches SSH server second key - /home/mariolet/github/podman/test/e2e/system_connection_test.go:596 @ 10/25/24 15:10:43.81
  < Exit [It] with a public key of the SSH server that matches SSH server second key - /home/mariolet/github/podman/test/e2e/system_connection_test.go:596 @ 10/25/24 15:10:44.313 (503ms)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:44.313
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-105281511/root --runroot /tmp/podman-e2e-2281833054/subtest-105281511/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-105281511/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-105281511 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-105281511/root --runroot /tmp/podman-e2e-2281833054/subtest-105281511/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-105281511/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-105281511 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-105281511/root --runroot /tmp/podman-e2e-2281833054/subtest-105281511/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-105281511/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-105281511 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:44.524 (211ms)
  << Timeline
------------------------------
• [0.255 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// with known_hosts
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:509
      ->
      /home/mariolet/github/podman/test/e2e/system_connection_test.go:537
        with a fake public key of the SSH server that doesn't match any of the SSH server keys (should fail)
        /home/mariolet/github/podman/test/e2e/system_connection_test.go:602

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:44.525
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:44.525 (0s)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:44.525
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:44.525 (0s)
  > Enter [It] with a fake public key of the SSH server that doesn't match any of the SSH server keys (should fail) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:602 @ 10/25/24 15:10:44.525
  time="2024-10-25T15:10:44Z" level=warning msg="ssh host key mismatch for host localhost:22, got key SHA256:xdDxsDmwVvJkueghu7VIQB+iF4jsQfuTEOYOasj1KmQ of type ssh-ed25519"
  Error: failed to connect: ssh: handshake failed: knownhosts: key mismatch
  < Exit [It] with a fake public key of the SSH server that doesn't match any of the SSH server keys (should fail) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:602 @ 10/25/24 15:10:44.578 (53ms)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:44.578
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1741937752/root --runroot /tmp/podman-e2e-2281833054/subtest-1741937752/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1741937752/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1741937752 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1741937752/root --runroot /tmp/podman-e2e-2281833054/subtest-1741937752/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1741937752/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1741937752 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-1741937752/root --runroot /tmp/podman-e2e-2281833054/subtest-1741937752/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-1741937752/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-1741937752 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:44.78 (202ms)
  << Timeline
------------------------------
• [0.743 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// with known_hosts
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:509
      ->
      /home/mariolet/github/podman/test/e2e/system_connection_test.go:537
        with no public key for the SSH server (new key should be added)
        /home/mariolet/github/podman/test/e2e/system_connection_test.go:608

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:44.781
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:44.782 (0s)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:44.782
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:44.782 (0s)
  > Enter [It] with no public key for the SSH server (new key should be added) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:608 @ 10/25/24 15:10:44.782
  < Exit [It] with no public key for the SSH server (new key should be added) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:608 @ 10/25/24 15:10:45.314 (532ms)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:45.314
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-679151185/root --runroot /tmp/podman-e2e-2281833054/subtest-679151185/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-679151185/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-679151185 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-679151185/root --runroot /tmp/podman-e2e-2281833054/subtest-679151185/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-679151185/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-679151185 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-679151185/root --runroot /tmp/podman-e2e-2281833054/subtest-679151185/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-679151185/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-679151185 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:45.524 (210ms)
  << Timeline
------------------------------
• [0.777 seconds]
podman system connection
/home/mariolet/github/podman/test/e2e/system_connection_test.go:43
  sshd and API services required
  /home/mariolet/github/podman/test/e2e/system_connection_test.go:429
    add ssh:// with known_hosts
    /home/mariolet/github/podman/test/e2e/system_connection_test.go:509
      ->
      /home/mariolet/github/podman/test/e2e/system_connection_test.go:537
        not existing (should be created and a new key should be added)
        /home/mariolet/github/podman/test/e2e/system_connection_test.go:614

  Timeline >>
  > Enter [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:45.525
  < Exit [BeforeEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:113 @ 10/25/24 15:10:45.526 (1ms)
  > Enter [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:45.526
  < Exit [BeforeEach] podman system connection - /home/mariolet/github/podman/test/e2e/system_connection_test.go:45 @ 10/25/24 15:10:45.526 (0s)
  > Enter [It] not existing (should be created and a new key should be added) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:614 @ 10/25/24 15:10:45.526
  < Exit [It] not existing (should be created and a new key should be added) - /home/mariolet/github/podman/test/e2e/system_connection_test.go:614 @ 10/25/24 15:10:46.06 (534ms)
  > Enter [AfterAll] sshd and API services required - /home/mariolet/github/podman/test/e2e/system_connection_test.go:452 @ 10/25/24 15:10:46.06
  < Exit [AfterAll] sshd and API services required - /home/mariolet/github/podman/test/e2e/system_connection_test.go:452 @ 10/25/24 15:10:46.06 (0s)
  > Enter [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:46.06
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-3371589571/root --runroot /tmp/podman-e2e-2281833054/subtest-3371589571/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-3371589571/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-3371589571 --events-backend file --db-backend sqlite --storage-driver overlay stop --all -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-3371589571/root --runroot /tmp/podman-e2e-2281833054/subtest-3371589571/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-3371589571/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-3371589571 --events-backend file --db-backend sqlite --storage-driver overlay pod rm -fa -t 0
  Running: /home/mariolet/github/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-2281833054/imagecachedir --root /tmp/podman-e2e-2281833054/subtest-3371589571/root --runroot /tmp/podman-e2e-2281833054/subtest-3371589571/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-2281833054/subtest-3371589571/root/etc/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-2281833054/subtest-3371589571 --events-backend file --db-backend sqlite --storage-driver overlay rm -fa -t 0
  < Exit [AfterEach] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:123 @ 10/25/24 15:10:46.303 (242ms)
  << Timeline
------------------------------
[SynchronizedAfterSuite] PASSED [0.000 seconds]
[SynchronizedAfterSuite]
/home/mariolet/github/podman/test/e2e/common_test.go:224

  Timeline >>
  > Enter [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.305
  < Exit [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.305 (0s)
  << Timeline
------------------------------
[SynchronizedAfterSuite] PASSED [0.252 seconds]
[SynchronizedAfterSuite]
/home/mariolet/github/podman/test/e2e/common_test.go:224

  Timeline >>
  > Enter [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.317
  < Exit [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.317 (0s)
  > Enter [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.318
  integration timing results
  podman system connection sshd and API services required add ssh:// with known_hosts -> with a fake public key of the SSH server that doesn't match any of the SSH server keys (should fail)		0.053378
  podman system connection sshd and API services required add ssh:// with known_hosts -> with a public key of the SSH server that matches SSH server second key		0.503470
  podman system connection sshd and API services required add ssh:// with known_hosts -> with no public key for the SSH server (new key should be added)		0.532677
  podman system connection sshd and API services required add ssh:// with known_hosts -> not existing (should be created and a new key should be added)		0.535134
  podman system connection sshd and API services required add ssh:// with known_hosts -> with a public key of the SSH server that matches the SSH server first key		0.649166
  podman system connection sshd and API services required add ssh:// socket path using connection heuristic		0.907943
  < Exit [SynchronizedAfterSuite] TOP-LEVEL - /home/mariolet/github/podman/test/e2e/common_test.go:224 @ 10/25/24 15:10:46.569 (252ms)
  << Timeline
------------------------------

Ran 6 of 2279 Specs in 10.257 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 2273 Skipped


Ginkgo ran 1 suite in 17.746204614s
Test Suite Passed

Depends on containers/common#2212
Fixes #23575

None

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 22, 2024
@l0rd l0rd force-pushed the ssh-knownhosts-test branch 6 times, most recently from 2c43969 to a52d965 Compare October 24, 2024 17:07
@l0rd l0rd force-pushed the ssh-knownhosts-test branch 6 times, most recently from 361aed9 to bbf8ffc Compare October 28, 2024 13:22
@l0rd l0rd force-pushed the ssh-knownhosts-test branch 3 times, most recently from 1745ea4 to ea0f53d Compare November 4, 2024 15:47
test/system/800-config.bats Outdated Show resolved Hide resolved
@Luap99
Copy link
Member

Luap99 commented Nov 7, 2024

#24447 is merged which should have your latest changes in there. So you can rebase and drop the vendor changes and only add the tests here

@l0rd l0rd force-pushed the ssh-knownhosts-test branch from ea0f53d to 1f10a61 Compare November 7, 2024 16:03
l0rd added 3 commits November 7, 2024 17:48
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
Version 2.3.0 of codespell allows using inline
comments to ignore some spelling errors.

codespell-project/codespell#2400

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
These tests verify that podman successfully adds (or
fails to add) a connection to an SSH server based on
the entries in the `~/.ssh/known_hosts` file.

In particular `system connection add` should succeed if:
- there is no `know_hosts` file
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry for another SSH server, not for the target server

It should fail if the `known_host` file has an entry for
the target server that matches the protocol but not the key.

Depends on containers/common#2212
Fixes containers#23575

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
@l0rd l0rd force-pushed the ssh-knownhosts-test branch from 1f10a61 to b20960b Compare November 7, 2024 16:50
@l0rd l0rd marked this pull request as ready for review November 7, 2024 23:29
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 7, 2024
@l0rd
Copy link
Member Author

l0rd commented Nov 7, 2024

#24447 is merged which should have your latest changes in there. So you can rebase and drop the vendor changes and only add the tests here

I have removed the vendoring commit and rebased. All tests are passing. @containers/podman-maintainers please have a look.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The int tests fail locally when I start sshd, that doesn't seem to be new here so I am fine to let this slide but these tests make a lot of (incorrect?) assumption about the hosts ssh key setup.

I really do not like that tests just decide rename known_hosts as this might have other unwanted side effects when other ssh things are running in parallel to the tests and if the tests are killed you get left with the renamed file.

I really think all of these tests must be rewritten in a way to not mess with the actul users .ssh. It should be safe to run tests on any system without having to worry about them messing up your home dir.

In any case this is pre-existing so I am fine with it. I did double checked that CI is running the tests on the rootless int tests so CI should catch regressions.

LGTM

Copy link
Contributor

openshift-ci bot commented Nov 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: l0rd, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@l0rd
Copy link
Member Author

l0rd commented Nov 8, 2024

I agree with you @Luap99

I was able to run the tests locally after adding an id_ed25519 SSH key pair. That's a check that could be added and, if the key doesn't exist, skip these tests.

To avoid modifying the local known_host file we should add a new flag to configure it's path. This is something I can work on when I am back from KubeCon.

@Luap99
Copy link
Member

Luap99 commented Nov 8, 2024

I was able to run the tests locally after adding an id_ed25519 SSH key pair. That's a check that could be added and, if the key doesn't exist, skip these tests.

Well I do have such a key but I have a passphrase on it so the system connection add fails with

failed to read identity "/home/pholzing/.ssh/id_ed25519": bcrypt_pbkdf: empty password

I also did not setup such a key to allow localhost ssh connection like the test wants so that would be the next issue

I don't think any attempt to make it work on a normal host setup is sane. IMO these tests need to be completely to not assume anything. I think the best way would be to run a container with ssh inside and then setup our own ssh keys so we do not pollute anything on the host ssh setup

@mheon
Copy link
Member

mheon commented Nov 8, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit a1c1ae6 into containers:main Nov 8, 2024
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempting to add a remote to podman results in key mismatch
3 participants