Skip to contentSkip to conversation

tests: Replace ncat with socat in migration test and drop ncat from containers

PATCH In review Thomas Huth 4 participants 4 messages Mar 16 – Mar 20 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Replace ncat with socat in migration test and drop ncat from containers

From: Thomas Huth <[email protected]>

nmap / ncat has a somewhat problematic license (e.g. saying claiming that derived work is also considered for software that "is designed specifically to execute Covered Software and parse the results", e.g. by executing ncat from your own program, you might already fall into this category) - so for example in openSUSE 16, you can only find it in the "non-OSS" repository.

We are currently only using it in the migration functional test, and that likely does not fall into this "derived work" category yet (since it is also doing some other stuff), but still, to be safe, we should move away from using it now.

Unfortunately, switching to one of the other flavors of netcat is also not a real option (see commit f700abbbeb6ab68a3446d1fb168a934d), but socat should be a solid replacement here instead.

To avoid that someone else easily uses ncat again, let's also remove it from our container files now.

---
 scripts/ci/setup/debian/debian-13-ppc64le.yaml        | 1 -
 scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml      | 1 -
 scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml        | 1 -
 tests/docker/dockerfiles/alpine.docker                | 1 -
 tests/docker/dockerfiles/centos9.docker               | 1 -
 tests/docker/dockerfiles/debian-amd64-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-arm64-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-armhf-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-i686-cross.docker     | 1 -
 tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 -
 tests/docker/dockerfiles/debian-mipsel-cross.docker   | 1 -
 tests/docker/dockerfiles/debian-ppc64el-cross.docker  | 1 -
 tests/docker/dockerfiles/debian-riscv64-cross.docker  | 1 -
 tests/docker/dockerfiles/debian-s390x-cross.docker    | 1 -
 tests/docker/dockerfiles/debian.docker                | 1 -
 tests/docker/dockerfiles/fedora-rust-nightly.docker   | 1 -
 tests/docker/dockerfiles/fedora-win64-cross.docker    | 1 -
 tests/docker/dockerfiles/fedora.docker                | 1 -
 tests/docker/dockerfiles/opensuse-leap.docker         | 1 -
 tests/docker/dockerfiles/ubuntu2204.docker            | 1 -
 tests/functional/migration.py                         | 4 ++--
 tests/lcitool/projects/qemu.yml                       | 1 -
 22 files changed, 2 insertions(+), 23 deletions(-)
scripts/ci/setup/debian/debian-13-ppc64le.yaml +0 -1
index 25d96cea460..b16d6d58f8e 100644
@@ -101,7 +101,6 @@ packages:
   - make
   - mtools
   - multipath-tools
-  - ncat
   - nettle-dev
   - ninja-build
   - openssh-client
scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml +0 -1
index 6a72eabca9e..b58fcda0fa3 100644
@@ -102,7 +102,6 @@ packages:
   - make
   - mtools
   - multipath-tools
-  - ncat
   - nettle-dev
   - ninja-build
   - openssh-client
scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml +0 -1
index 6001da12504..fa439db4ca1 100644
@@ -100,7 +100,6 @@ packages:
   - make
   - mtools
   - multipath-tools
-  - ncat
   - nettle-dev
   - ninja-build
   - openssh-client
tests/docker/dockerfiles/alpine.docker +0 -1
index c0303feb48a..a7ee85fcda7 100644
@@ -76,7 +76,6 @@ RUN apk update && \
         ndctl-dev \
         net-tools \
         nettle-dev \
-        nmap-ncat \
         numactl-dev \
         openssh-client \
         pcre2-dev \
tests/docker/dockerfiles/centos9.docker +0 -1
index 6b1aa6dc0de..41a1225856e 100644
@@ -87,7 +87,6 @@ RUN dnf --quiet distro-sync -y && \
                 ncurses-devel \
                 nettle-devel \
                 ninja-build \
-                nmap-ncat \
                 numactl-devel \
                 openssh-clients \
                 pam-devel \
tests/docker/dockerfiles/debian-amd64-cross.docker +0 -1
index c386b658b04..6fad808e1b6 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-arm64-cross.docker +0 -1
index 9d83ab7a32e..889d8a1a755 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-armhf-cross.docker +0 -1
index c2077ec7a2c..988c87075f6 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-i686-cross.docker +0 -1
index db9f04ee93d..d720ebb0bca 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-mips64el-cross.docker +0 -1
index 7758afd80aa..90a2ef15574 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-mipsel-cross.docker +0 -1
index cba7f43870f..b7e36b3d974 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-ppc64el-cross.docker +0 -1
index 24f946d1441..a70fbee0c1d 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-riscv64-cross.docker +0 -1
index f476cf65eaa..9ada5ecce0d 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian-s390x-cross.docker +0 -1
index a60b4ab01d1..a1de94ff9aa 100644
@@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       locales \
                       make \
                       mtools \
-                      ncat \
                       ninja-build \
                       openssh-client \
                       pkgconf \
tests/docker/dockerfiles/debian.docker +0 -1
index 6c6ab0256ea..c34923b253d 100644
@@ -109,7 +109,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       make \
                       mtools \
                       multipath-tools \
-                      ncat \
                       nettle-dev \
                       ninja-build \
                       openssh-client \
tests/docker/dockerfiles/fedora-rust-nightly.docker +0 -1
index 043b42a0a9b..0c5739140d7 100644
@@ -96,7 +96,6 @@ exec "$@"\n' > /usr/bin/nosync && \
                        ncurses-devel \
                        nettle-devel \
                        ninja-build \
-                       nmap-ncat \
                        numactl-devel \
                        openssh-clients \
                        pam-devel \
tests/docker/dockerfiles/fedora-win64-cross.docker +0 -1
index 818485c4ba2..751789e849b 100644
@@ -42,7 +42,6 @@ exec "$@"\n' > /usr/bin/nosync && \
                        make \
                        mtools \
                        ninja-build \
-                       nmap-ncat \
                        openssh-clients \
                        python3 \
                        python3-PyYAML \
tests/docker/dockerfiles/fedora.docker +0 -1
index 32aaf01aff4..ec787aa7027 100644
@@ -96,7 +96,6 @@ exec "$@"\n' > /usr/bin/nosync && \
                        ncurses-devel \
                        nettle-devel \
                        ninja-build \
-                       nmap-ncat \
                        numactl-devel \
                        openssh-clients \
                        pam-devel \
tests/docker/dockerfiles/opensuse-leap.docker +0 -1
index d693f2c6f85..52ef1176b5a 100644
@@ -86,7 +86,6 @@ RUN zypper update -y && \
            lzo-devel \
            make \
            mtools \
-           ncat \
            ncurses-devel \
            ninja \
            openssh \
tests/docker/dockerfiles/ubuntu2204.docker +0 -1
index 23b33d6ad44..d5e5e372a40 100644
@@ -107,7 +107,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       make \
                       mtools \
                       multipath-tools \
-                      ncat \
                       nettle-dev \
                       ninja-build \
                       openssh-client \
tests/functional/migration.py +2 -2
index e995328e833..2395119d6c6 100644
@@ -84,6 +84,6 @@ def migration_with_exec(self):
             self.skipTest('ncat is not available')
         with Ports() as ports:
             free_port = self._get_free_port(ports)
-            dst_uri = 'exec:ncat -l localhost %u' % free_port
-            src_uri = 'exec:ncat localhost %u' % free_port
+            dst_uri = 'exec:socat TCP-LISTEN:%u -' % free_port
+            src_uri = 'exec:socat - TCP:localhost:%u' % free_port
             self.migrate(dst_uri, src_uri)
tests/lcitool/projects/qemu.yml +0 -1
index 5e34e953514..bee7a620ca9 100644
@@ -83,7 +83,6 @@ packages:
  - meson
  - mtools
  - ncursesw
- - netcat
  - nettle
  - ninja
  - nsis
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 39 lines · Thomas Huth

From: Thomas Huth <[email protected]>

nmap / ncat has a somewhat problematic license (e.g. saying claiming that derived work is also considered for software that "is designed specifically to execute Covered Software and parse the results", e.g. by executing ncat from your own program, you might already fall into this category) - so for example in openSUSE 16, you can only find it in the "non-OSS" repository.

We are currently only using it in the migration functional test, and that likely does not fall into this "derived work" category yet (since it is also doing some other stuff), but still, to be safe, we should move away from using it now.

Unfortunately, switching to one of the other flavors of netcat is also not a real option (see commit f700abbbeb6ab68a3446d1fb168a934d), but socat should be a solid replacement here instead.

To avoid that someone else easily uses ncat again, let's also remove it from our container files now.

---
  scripts/ci/setup/debian/debian-13-ppc64le.yaml        | 1 -
  scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml      | 1 -
  scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml        | 1 -
  tests/docker/dockerfiles/alpine.docker                | 1 -
  tests/docker/dockerfiles/centos9.docker               | 1 -
  tests/docker/dockerfiles/debian-amd64-cross.docker    | 1 -
  tests/docker/dockerfiles/debian-arm64-cross.docker    | 1 -
  tests/docker/dockerfiles/debian-armhf-cross.docker    | 1 -
  tests/docker/dockerfiles/debian-i686-cross.docker     | 1 -
  tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 -
  tests/docker/dockerfiles/debian-mipsel-cross.docker   | 1 -
  tests/docker/dockerfiles/debian-ppc64el-cross.docker  | 1 -
  tests/docker/dockerfiles/debian-riscv64-cross.docker  | 1 -
  tests/docker/dockerfiles/debian-s390x-cross.docker    | 1 -
  tests/docker/dockerfiles/debian.docker                | 1 -
Quoted 8 lines
  tests/docker/dockerfiles/fedora-rust-nightly.docker   | 1 -
  tests/docker/dockerfiles/fedora-win64-cross.docker    | 1 -
  tests/docker/dockerfiles/fedora.docker                | 1 -
  tests/docker/dockerfiles/opensuse-leap.docker         | 1 -
  tests/docker/dockerfiles/ubuntu2204.docker            | 1 -
  tests/functional/migration.py                         | 4 ++--
  tests/lcitool/projects/qemu.yml                       | 1 -
  22 files changed, 2 insertions(+), 23 deletions(-)
Acked-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 18 lines · Thomas Huth

From: Thomas Huth <[email protected]>

nmap / ncat has a somewhat problematic license (e.g. saying claiming that derived work is also considered for software that "is designed specifically to execute Covered Software and parse the results", e.g. by executing ncat from your own program, you might already fall into this category) - so for example in openSUSE 16, you can only find it in the "non-OSS" repository.

We are currently only using it in the migration functional test, and that likely does not fall into this "derived work" category yet (since it is also doing some other stuff), but still, to be safe, we should move away from using it now.

Unfortunately, switching to one of the other flavors of netcat is also not a real option (see commit f700abbbeb6ab68a3446d1fb168a934d), but socat should be a solid replacement here instead.

Quoted 5 lines

To avoid that someone else easily uses ncat again, let's also remove it from our container files now.

Signature · 1 line
Peter Xu
#3 lore raw
In reply to Thomas Huth
Quoted 18 lines · Thomas Huth

From: Thomas Huth <[email protected]>

nmap / ncat has a somewhat problematic license (e.g. saying claiming that derived work is also considered for software that "is designed specifically to execute Covered Software and parse the results", e.g. by executing ncat from your own program, you might already fall into this category) - so for example in openSUSE 16, you can only find it in the "non-OSS" repository.

We are currently only using it in the migration functional test, and that likely does not fall into this "derived work" category yet (since it is also doing some other stuff), but still, to be safe, we should move away from using it now.

Unfortunately, switching to one of the other flavors of netcat is also not a real option (see commit f700abbbeb6ab68a3446d1fb168a934d), but socat should be a solid replacement here instead.

Quoted 5 lines

To avoid that someone else easily uses ncat again, let's also remove it from our container files now.

Queued to testing/next, thanks.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro