From 2540529717736bfa5edd911045d21d2f592f7448 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 12:12:45 +0300 Subject: [PATCH 01/66] CI: Usage of separated machine for RemoteOperations tests --- .github/workflows/ci.yml | 58 +++++++++++++++++++++--------------- Dockerfile--alpine.tmpl | 47 ++++++++++++++++++----------- tests/helpers/global_data.py | 8 +++-- 3 files changed, 68 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f6e4cf..067faf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,30 +72,8 @@ jobs: fail-fast: false matrix: include: - - platform: "alpine" - python: "3.7" - - platform: "alpine" - python: "3.8" - - platform: "alpine" - python: "3.9" - - platform: "alpine" - python: "3.10" - - platform: "alpine" - python: "3.11" - platform: "alpine" python: "3.12" - - platform: "alpine" - python: "3.13" - - platform: "alpine" - python: "3.14" - - platform: "ubuntu_24_04" - python: "3" - - platform: "altlinux_10" - python: "3" - - platform: "altlinux_11" - python: "3" - - platform: "astralinux_1_7" - python: "3" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" @@ -116,8 +94,40 @@ jobs: run: chmod -R 777 "${{ env.RUN_CFG__LOGS_DIR }}" - name: Build local image ${{ matrix.alpine }} run: docker build --build-arg PYTHON_VERSION="${{ matrix.python }}" -t "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" -f Dockerfile--${{ matrix.platform }}.tmpl . - - name: Run - run: docker run -t -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" + + - name: Generate temporary SSH Key pair for CI + run: | + # Generate a key without a password directly on the GitHub Actions host + ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/id_ed25519 + # Create a folder structure for forwarding the key to the test user + mkdir -p ${{ github.workspace }}/remote2_ssh + cat ${{ github.workspace }}/id_ed25519.pub > ${{ github.workspace }}/remote2_ssh/authorized_keys + chmod 600 ${{ github.workspace }}/remote2_ssh/authorized_keys + + - name: Run second target host (remote2) + run: | + # Launch a second container in the background (-d) named "remote2" + # Add the generated key to its authorized_keys for the user "test" + # Redefine CMD to "sleep infinity" so it runs as a bare server + docker run -d --name remote2 \ + -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys:ro \ + "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ + sleep infinity + + - name: Run Main Test Container + run: | + # Launch the main container, passing the private key to the .ssh folder of the test user. + # Pass environment variables so Python tests know where to start. + # Link the containers using --link so the name "remote2" resolves to an IP address. + docker run -t \ + --link remote2:remote2 \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ + -v ${{ github.workspace }}/id_ed25519:/home/test/.ssh/id_ed25519:ro \ + -e TEST_PARAM_REMOTE2_HOST="remote2" \ + -e TEST_PARAM_REMOTE2_USERNAME="test" \ + -e TEST_PARAM_REMOTE2_SSH_KEY="/home/test/.ssh/id_ed25519" \ + "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" + - name: Upload Logs uses: actions/upload-artifact@v7 if: always() # IT IS IMPORTANT! diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index f78af01..c0ace77 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -14,6 +14,7 @@ RUN apk add git # --------------------------------------------- final FROM base2 AS final +RUN apk update RUN apk add mc RUN apk add bash @@ -21,6 +22,7 @@ RUN apk add bash RUN apk add --no-cache procps RUN apk add --no-cache openssh +RUN apk add --no-cache sshpass RUN apk add --no-cache sudo RUN adduser -D test @@ -40,24 +42,33 @@ RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers # THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD RUN sh -c "echo "test:*" | chpasswd -e" -USER test +RUN chmod 700 /home/test/ +RUN mkdir -p /home/test/.ssh +RUN chown -R test:test /home/test/.ssh -# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD -RUN chmod 700 ~/ - -RUN mkdir -p ~/.ssh -#RUN chmod 700 ~/.ssh +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + /usr/sbin/sshd; \ + exec \"$@\"; \ +"] -ENTRYPOINT sh -c " \ +# Run tests by default (master machine role) +CMD ["bash", "bash", "-c", " \ set -eux; \ -echo HELLO FROM ENTRYPOINT; \ -echo HOME DIR IS [`realpath ~/`]; \ -echo WORK DIR IS [$(pwd)]; \ -ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ -chmod 600 ~/.ssh/authorized_keys; \ -ls -la ~/.ssh/; \ -sudo /usr/sbin/sshd; \ -ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ -ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ -bash run_tests3.sh;" +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ +su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +fi; \ +ls -la ./; \ +su test -c \"bash ./run_tests3.sh\"; \ +"] diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index f66772e..f107711 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -19,9 +19,11 @@ def __init__(self, sign: str, os_ops: OsOperations): class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( - host=os.getenv('RDBMS_TESTPOOL1_HOST') or '127.0.0.1', - username=os.getenv('USER'), - ssh_key=os.getenv('RDBMS_TESTPOOL_SSHKEY')) + host=os.getenv('TEST_PARAM_REMOTE2_HOST') or '127.0.0.1', + username=os.getenv('TEST_PARAM_REMOTE2_USERNAME'), + ssh_key=os.getenv('TEST_PARAM_REMOTE2_SSH_KEY'), + password=os.getenv('TEST_PARAM_REMOTE2_PASSWORD'), + ) sm_remote_os_ops = RemoteOperations(sm_remote_conn_params) From 468b53913b4274ad1ca0096c17929ca9611065f7 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 12:43:29 +0300 Subject: [PATCH 02/66] CI: CMD is fixed (zero element is ignored!) --- .github/workflows/ci.yml | 2 +- Dockerfile--alpine.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 067faf2..ca6c850 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: docker run -d --name remote2 \ -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity + - sleep infinity - name: Run Main Test Container run: | diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index c0ace77..7e1d4fc 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -50,11 +50,11 @@ ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ /usr/sbin/sshd; \ - exec \"$@\"; \ + \"$@\"; \ "] # Run tests by default (master machine role) -CMD ["bash", "bash", "-c", " \ +CMD ["", "bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ From fcb3d0c438f5299906d64de44a0b97a84272ce19 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 13:38:23 +0300 Subject: [PATCH 03/66] CI: Copy TEST_PARAM_REMOTE2_SSH_KEY to file with right attributes --- Dockerfile--alpine.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 7e1d4fc..1f88cac 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -69,6 +69,12 @@ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ +if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +fi; \ ls -la ./; \ su test -c \"bash ./run_tests3.sh\"; \ "] From 439dc43ecef76127b0b531aa4f42cc824d0002ab Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 13:43:45 +0300 Subject: [PATCH 04/66] CI: More prints of '/home/test/.ssh/' content --- Dockerfile--alpine.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 1f88cac..f29dda3 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -50,6 +50,7 @@ ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ /usr/sbin/sshd; \ + ls -la /home/test/.ssh/; \ \"$@\"; \ "] @@ -74,6 +75,7 @@ if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ su test -c \"bash ./run_tests3.sh\"; \ From 66a2bb2bb1f720b7d663ca0b14e626e5a870b264 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 13:57:36 +0300 Subject: [PATCH 05/66] CI: Try to fix 'authorized_keys' on the second machine --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca6c850..b603a6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,9 +110,15 @@ jobs: # Add the generated key to its authorized_keys for the user "test" # Redefine CMD to "sleep infinity" so it runs as a bare server docker run -d --name remote2 \ - -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys:ro \ + -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - - sleep infinity + - \ + cp /tmp/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + chown test:test /home/test/.ssh/authorized_keys && \ + chmod 600 /home/test/.ssh/authorized_keys && \ + chmod 700 /home/test/.ssh && \ + ls -la /home/test/.ssh/ && \ + sleep infinity - name: Run Main Test Container run: | From a522d25cd8b669b1c881375d33f0d08c64a8ee17 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:07:31 +0300 Subject: [PATCH 06/66] CI: no lint and no build-check (temporary) --- .github/workflows/ci.yml | 50 ---------------------------------------- 1 file changed, 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b603a6a..dd7183a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,56 +15,6 @@ on: - "*.md" jobs: - lint: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - - steps: - - name: Checkout - uses: actions/checkout@v7 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 flake8-pyproject ruff - - name: Lint with flake8 - run: | - flake8 . - - name: Lint with ruff - run: | - ruff check . - - build-check: - runs-on: ubuntu-latest - needs: lint - steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Set up Python 3.12 - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - - name: Install build tools - run: | - python -m pip install --upgrade pip - python -m pip install build twine - - - name: Build package - run: | - python -m build - - - name: Check package metadata - run: | - twine check dist/* - test: runs-on: ubuntu-latest needs: build-check From d8bd222cd189e5bb82ef2d3a0bee0663749174a2 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:08:06 +0300 Subject: [PATCH 07/66] CI: bad path to authorized_keys_ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd7183a..06a3be1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - \ - cp /tmp/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ chown test:test /home/test/.ssh/authorized_keys && \ chmod 600 /home/test/.ssh/authorized_keys && \ chmod 700 /home/test/.ssh && \ From 4d702aa0df32a55ee09e0a81dbfbf7c5a03a856a Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:09:12 +0300 Subject: [PATCH 08/66] CI: fix "needs" --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06a3be1..7b91ed8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ on: jobs: test: runs-on: ubuntu-latest - needs: build-check strategy: fail-fast: false matrix: From eb5deee1e0111ab21806c67cff03e2883f76a8a9 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:15:20 +0300 Subject: [PATCH 09/66] CI: More logs for remote2 machine --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b91ed8..73917f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,12 @@ jobs: -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - \ + echo "----------------" && \ + getent passwd && \ + echo "----------------" && \ + ls -la /home/test/.ssh/ && \ cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + ls -la /home/test/.ssh/ && \ chown test:test /home/test/.ssh/authorized_keys && \ chmod 600 /home/test/.ssh/authorized_keys && \ chmod 700 /home/test/.ssh && \ From f04c1f2f497e9eac5c469db214f7c4e0261936d0 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:26:29 +0300 Subject: [PATCH 10/66] CI: More logs for remote2 machine (2) --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73917f4..222adfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,9 +62,16 @@ jobs: -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - \ - echo "----------------" && \ + echo "---------------- OS" && \ + cat /etc/os-release + echo "---------------- USERS" && \ getent passwd && \ - echo "----------------" && \ + echo "---------------- DIRS" && \ + echo "HOME DIR IS [`realpath ~/`]" && \ + echo "WORK DIR IS [$(pwd)]" && \ + echo "---------------- WORK DIR" && \ + ls -la ./ && \ + echo "---------------- .SSH" && \ ls -la /home/test/.ssh/ && \ cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ ls -la /home/test/.ssh/ && \ From 4b0e2e6179aaa7e8d0090efe549ac82889d1f885 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:39:42 +0300 Subject: [PATCH 11/66] CI: A mistake in correction command is fixed --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 222adfb..2e853cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: docker run -d --name remote2 \ -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - - \ + - bash -c '\ echo "---------------- OS" && \ cat /etc/os-release echo "---------------- USERS" && \ @@ -79,7 +79,8 @@ jobs: chmod 600 /home/test/.ssh/authorized_keys && \ chmod 700 /home/test/.ssh && \ ls -la /home/test/.ssh/ && \ - sleep infinity + sleep infinity \ + ' - name: Run Main Test Container run: | From 100d451d48642c3d0c7f75be3b85b5ece297830a Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:42:39 +0300 Subject: [PATCH 12/66] CI: A mistake in correction command is fixed (2) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e853cd..a4e85cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - bash -c '\ echo "---------------- OS" && \ - cat /etc/os-release + cat /etc/os-release " && \ echo "---------------- USERS" && \ getent passwd && \ echo "---------------- DIRS" && \ From 90229feec576702cb4428c44c1d5e95289d72eb6 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:51:10 +0300 Subject: [PATCH 13/66] CI: A mistake in correction command is fixed (3) --- .github/workflows/ci.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e85cb..87c1188 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,26 +61,26 @@ jobs: docker run -d --name remote2 \ -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - - bash -c '\ - echo "---------------- OS" && \ - cat /etc/os-release " && \ - echo "---------------- USERS" && \ - getent passwd && \ - echo "---------------- DIRS" && \ - echo "HOME DIR IS [`realpath ~/`]" && \ - echo "WORK DIR IS [$(pwd)]" && \ - echo "---------------- WORK DIR" && \ - ls -la ./ && \ - echo "---------------- .SSH" && \ - ls -la /home/test/.ssh/ && \ - cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ - ls -la /home/test/.ssh/ && \ - chown test:test /home/test/.ssh/authorized_keys && \ - chmod 600 /home/test/.ssh/authorized_keys && \ - chmod 700 /home/test/.ssh && \ - ls -la /home/test/.ssh/ && \ - sleep infinity \ - ' + - bash -c "\ + echo \"---------------- OS\" && \ + cat /etc/os-release + echo \"---------------- USERS\" && \ + getent passwd && \ + echo \"---------------- DIRS\" && \ + echo \"HOME DIR IS [`realpath ~/`]\" && \ + echo \"WORK DIR IS [$(pwd)]\" && \ + echo \"---------------- WORK DIR\" && \ + ls -la ./ && \ + echo \"---------------- .SSH\" && \ + ls -la /home/test/.ssh/ && \ + cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + ls -la /home/test/.ssh/ && \ + chown test:test /home/test/.ssh/authorized_keys && \ + chmod 600 /home/test/.ssh/authorized_keys && \ + chmod 700 /home/test/.ssh && \ + ls -la /home/test/.ssh/ && \ + sleep infinity \ + " - name: Run Main Test Container run: | From fc20863e7dda09ac53b2125c881016e4508082c3 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 14:57:11 +0300 Subject: [PATCH 14/66] CI: Run the second machine with "-t" option --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87c1188..8af720c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: # Launch a second container in the background (-d) named "remote2" # Add the generated key to its authorized_keys for the user "test" # Redefine CMD to "sleep infinity" so it runs as a bare server - docker run -d --name remote2 \ + docker run -d -t --name remote2 \ -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - bash -c "\ From bf8134dda6d2f2e5676c9bc6c56230e511b197d8 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 15:24:02 +0300 Subject: [PATCH 15/66] CI: Two stage for second machine: run_with_detach + ssh_file_correction --- .github/workflows/ci.yml | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8af720c..8f0def6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,32 +55,24 @@ jobs: - name: Run second target host (remote2) run: | - # Launch a second container in the background (-d) named "remote2" - # Add the generated key to its authorized_keys for the user "test" - # Redefine CMD to "sleep infinity" so it runs as a bare server docker run -d -t --name remote2 \ -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - - bash -c "\ - echo \"---------------- OS\" && \ - cat /etc/os-release - echo \"---------------- USERS\" && \ - getent passwd && \ - echo \"---------------- DIRS\" && \ - echo \"HOME DIR IS [`realpath ~/`]\" && \ - echo \"WORK DIR IS [$(pwd)]\" && \ - echo \"---------------- WORK DIR\" && \ - ls -la ./ && \ - echo \"---------------- .SSH\" && \ - ls -la /home/test/.ssh/ && \ - cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ - ls -la /home/test/.ssh/ && \ - chown test:test /home/test/.ssh/authorized_keys && \ - chmod 600 /home/test/.ssh/authorized_keys && \ - chmod 700 /home/test/.ssh && \ - ls -la /home/test/.ssh/ && \ - sleep infinity \ - " + - sleep infinity + + sleep 1.0 + + docker exec -u root remote2 sh -c " + echo '--- INSIDE CONTAINER OS ---' && \ + cat /etc/os-release && \ + echo '---' && \ + cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + chown test.test /home/test/.ssh/authorized_keys && \ + chmod 600 /home/test/.ssh/authorized_keys && \ + chmod 700 /home/test/.ssh && \ + echo '--- INSIDE CONTAINER .SSH ---' && \ + ls -la /home/test/.ssh/ + " - name: Run Main Test Container run: | From 3e97ddcba890ec7da31c24700489fce4afcfb67a Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 15:59:49 +0300 Subject: [PATCH 16/66] CI: Normalization - RUN_CFG__REMOTE2_NAME - RUN_CFG__SSH_KEY_NAME --- .github/workflows/ci.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f0def6..bd3fb22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,8 @@ jobs: echo "RUN_CFG__NOW=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__REMOTE2_NAME=remote2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" cat $GITHUB_ENV - name: Checkout @@ -47,22 +49,18 @@ jobs: - name: Generate temporary SSH Key pair for CI run: | # Generate a key without a password directly on the GitHub Actions host - ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/id_ed25519 - # Create a folder structure for forwarding the key to the test user - mkdir -p ${{ github.workspace }}/remote2_ssh - cat ${{ github.workspace }}/id_ed25519.pub > ${{ github.workspace }}/remote2_ssh/authorized_keys - chmod 600 ${{ github.workspace }}/remote2_ssh/authorized_keys + ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} - name: Run second target host (remote2) run: | - docker run -d -t --name remote2 \ - -v ${{ github.workspace }}/remote2_ssh/authorized_keys:/home/test/.ssh/authorized_keys_ci:ro \ + docker run -d -t --name ${{ env.RUN_CFG__REMOTE2_NAME }} \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity sleep 1.0 - docker exec -u root remote2 sh -c " + docker exec -u root ${{ env.RUN_CFG__REMOTE2_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ echo '---' && \ @@ -80,10 +78,10 @@ jobs: # Pass environment variables so Python tests know where to start. # Link the containers using --link so the name "remote2" resolves to an IP address. docker run -t \ - --link remote2:remote2 \ + --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ - -v ${{ github.workspace }}/id_ed25519:/home/test/.ssh/id_ed25519:ro \ - -e TEST_PARAM_REMOTE2_HOST="remote2" \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/.ssh/id_ed25519:ro \ + -e TEST_PARAM_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ -e TEST_PARAM_REMOTE2_USERNAME="test" \ -e TEST_PARAM_REMOTE2_SSH_KEY="/home/test/.ssh/id_ed25519" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" From 113c768f8be1ed25222f0188cb2c30a9fea3fa19 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 16:08:25 +0300 Subject: [PATCH 17/66] CI: All the alpines are restored --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd3fb22..6a23042 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,22 @@ jobs: fail-fast: false matrix: include: + - platform: "alpine" + python: "3.7" + - platform: "alpine" + python: "3.8" + - platform: "alpine" + python: "3.9" + - platform: "alpine" + python: "3.10" + - platform: "alpine" + python: "3.11" - platform: "alpine" python: "3.12" + - platform: "alpine" + python: "3.13" + - platform: "alpine" + python: "3.14" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" From b0f3fcb90f52488531a1d48e8bac483daceca4a0 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 16:49:08 +0300 Subject: [PATCH 18/66] CI: ubuntu 24.04 is restored --- .github/workflows/ci.yml | 2 ++ Dockerfile--ubuntu_24_04.tmpl | 59 ++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a23042..df5c98d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,8 @@ jobs: python: "3.13" - platform: "alpine" python: "3.14" + - platform: "ubuntu_24_04" + python: "3" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index d953a52..507126a 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -7,6 +7,7 @@ RUN apt update RUN apt install -y sudo curl ca-certificates RUN apt update RUN apt install -y openssh-server +RUN apt install -y sshpass RUN apt install -y time RUN apt install -y netcat-traditional @@ -23,7 +24,6 @@ ENV PYTHON_VERSION=3 FROM base2_with_python-${PYTHON_VERSION} AS final EXPOSE 22 - RUN ssh-keygen -A RUN useradd -m test @@ -36,21 +36,42 @@ WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -USER test - -RUN chmod 700 ~/ -RUN mkdir -p ~/.ssh - -ENTRYPOINT sh -c " \ -#set -eux; \ -echo HELLO FROM ENTRYPOINT; \ -echo HOME DIR IS [`realpath ~/`]; \ -service ssh enable; \ -sudo service ssh start; \ -ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ -ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ -ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ -chmod 600 ~/.ssh/authorized_keys; \ -ls -la ~/.ssh/; \ -TEST_FILTER=\"\" bash ./run_tests3.sh;" +RUN chmod 700 /home/test/ +RUN mkdir -p /home/test/.ssh +RUN chown -R test:test /home/test/.ssh + +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + # service ssh enable; \ + service ssh start; \ + ls -la /home/test/.ssh/; \ + \"$@\"; \ +"] + +# Run tests by default (master machine role) +CMD ["", "bash", "-c", " \ +set -eux; \ +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ +su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +fi; \ +if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ +fi; \ +ls -la ./; \ +su test -c \"bash ./run_tests3.sh\"; \ +"] From faaf8c3481429ed40149643d462e2ab7611f1624 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 17:18:18 +0300 Subject: [PATCH 19/66] CI: ubuntu 24.04 is updated (cleanup) --- Dockerfile--ubuntu_24_04.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index 507126a..e1076c8 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -43,7 +43,6 @@ RUN chown -R test:test /home/test/.ssh ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ - # service ssh enable; \ service ssh start; \ ls -la /home/test/.ssh/; \ \"$@\"; \ From 2ffa576eee503121c409975b4108a1e5f54aa140 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 17:19:12 +0300 Subject: [PATCH 20/66] CI: astralinux 1.7 is restored --- .github/workflows/ci.yml | 2 ++ Dockerfile--astralinux_1_7.tmpl | 53 ++++++++++++++++++++++----------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df5c98d..f765a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: python: "3.14" - platform: "ubuntu_24_04" python: "3" + - platform: "astralinux_1_7" + python: "3" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index b68b2fa..a2118ab 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -7,6 +7,7 @@ RUN apt update RUN apt install -y sudo curl ca-certificates RUN apt update RUN apt install -y openssh-server +RUN apt install -y sshpass # RUN apt install -y time # RUN apt install -y netcat-traditional @@ -24,7 +25,6 @@ ENV PYTHON_VERSION=3 FROM base2_with_python-${PYTHON_VERSION} AS final EXPOSE 22 - RUN ssh-keygen -A RUN useradd -m test @@ -44,22 +44,41 @@ WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -USER test +RUN chmod 700 /home/test/ +RUN mkdir -p /home/test/.ssh +RUN chown -R test:test /home/test/.ssh -RUN chmod 700 ~/ -RUN mkdir -p ~/.ssh -RUN chmod 700 ~/.ssh +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + service ssh start; \ + ls -la /home/test/.ssh/; \ + \"$@\"; \ +"] -ENTRYPOINT sh -c " \ +# Run tests by default (master machine role) +CMD ["", "bash", "-c", " \ set -eux; \ -echo HELLO FROM ENTRYPOINT; \ -echo HOME DIR IS [`realpath ~/`]; \ -# sudo service ssh enable; \ -sudo service ssh start; \ -ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ -ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ -ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ -chmod 600 ~/.ssh/authorized_keys; \ -ls -la ~/.ssh/; \ -TEST_FILTER=\"\" bash run_tests3.sh;" +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ +su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +fi; \ +if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ +fi; \ +ls -la ./; \ +su test -c \"bash ./run_tests3.sh\"; \ +"] From 9801be1dce4a01b83e7fa3359a0c663d30bef440 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 17:20:18 +0300 Subject: [PATCH 21/66] CI: run_tests3.sh is updated (#!/bin/bash) --- run_tests3.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run_tests3.sh b/run_tests3.sh index 00c7b7b..af70f5e 100755 --- a/run_tests3.sh +++ b/run_tests3.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash - +#!/bin/bash set -eux # prepare python environment From 8b6bfaf6e9cd9cd421b9a72be55930cb52184799 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 17:52:54 +0300 Subject: [PATCH 22/66] CI: alpine, astra_1_7 and ubuntu 24.04 is corrected --- Dockerfile--alpine.tmpl | 2 +- Dockerfile--astralinux_1_7.tmpl | 2 +- Dockerfile--ubuntu_24_04.tmpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index f29dda3..2c4d1ec 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -61,7 +61,7 @@ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ if [ ! -f /home/test/.ssh/id_rsa ]; then \ su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ - su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\"; \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index a2118ab..647e9a9 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -63,7 +63,7 @@ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ if [ ! -f /home/test/.ssh/id_rsa ]; then \ su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ - su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\"; \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index e1076c8..b9824eb 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -55,7 +55,7 @@ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ if [ ! -f /home/test/.ssh/id_rsa ]; then \ su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ - su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys;\" \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\"; \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ From 1cc3f5c404dedd512ae394fba4660f917e3a6a32 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 18:40:09 +0300 Subject: [PATCH 23/66] CI: altlinux 11 is restored --- .github/workflows/ci.yml | 2 ++ Dockerfile--altlinux_11.tmpl | 54 +++++++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f765a5b..1d19475 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,8 @@ jobs: python: "3" - platform: "astralinux_1_7" python: "3" + - platform: "altlinux_11" + python: "3" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index 8f0f426..b51682a 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -7,7 +7,9 @@ RUN apt-get update RUN apt-get install -y sudo curl ca-certificates RUN apt-get update RUN apt-get install -y openssh-server openssh-clients +RUN apt-get install -y sshpass RUN apt-get install -y time +RUN apt-get install -y su # pgrep (for testgres.os_ops) RUN apt-get install -y procps @@ -15,7 +17,6 @@ RUN apt-get install -y procps # RUN apt-get install -y mc EXPOSE 22 - RUN ssh-keygen -A # --------------------------------------------- dev_tools @@ -44,24 +45,45 @@ WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -USER test - -RUN chmod 700 ~/ -RUN mkdir -p ~/.ssh +RUN chmod 700 /home/test/ +RUN mkdir -p /home/test/.ssh +RUN chown -R test:test /home/test/.ssh # # Altlinux 10 and 11 too slowly create a new SSH connection (x6). # -ENTRYPOINT sh -c " \ +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + /usr/sbin/sshd; \ + ls -la /home/test/.ssh/; \ + \"$@\"; \ +"] + +# Run tests by default (master machine role) +CMD ["", "bash", "-c", " \ set -eux; \ -echo HELLO FROM ENTRYPOINT; \ -echo HOME DIR IS [`realpath ~/`]; \ -sudo /usr/sbin/sshd; \ -ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ -ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ -ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ -chmod 600 ~/.ssh/authorized_keys; \ -ls -la ~/.ssh/; \ -TEST_FILTER=\"\" bash ./run_tests3.sh;" +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\" test; \ + su -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\" test; \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ +su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +fi; \ +if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ +fi; \ +ls -la ./; \ +su - test -c \"cd /home/test/testgres && bash ./run_tests3.sh\"; \ +"] From e35db04873a999b369696ea95e85dafb050e7acb Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 19:17:34 +0300 Subject: [PATCH 24/66] CI: Put id_ed25519 into /home/test/testgres/id_ed25519_test It may fix a problem on AltLinux: FAILED tests/test_os_ops_common.py::TestOsOpsCommon::test_kill__unk_pid[remote_ops-signal: 15] - assert 'ssh: Load key "/home/test/.ssh/id_ed25519": Permission denied\nb\n' == 'b\n' + ssh: Load key "/home/test/.ssh/id_ed25519": Permission denied b --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d19475..4ad48b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,10 +100,10 @@ jobs: docker run -t \ --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ - -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/.ssh/id_ed25519:ro \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ -e TEST_PARAM_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ -e TEST_PARAM_REMOTE2_USERNAME="test" \ - -e TEST_PARAM_REMOTE2_SSH_KEY="/home/test/.ssh/id_ed25519" \ + -e TEST_PARAM_REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" - name: Upload Logs From e33cf501ea7bc9c0c03d2b41bf5cab3cbaad3398 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 19:34:36 +0300 Subject: [PATCH 25/66] CI: altlinux 10 is restored --- .github/workflows/ci.yml | 4 ++- Dockerfile--altlinux_10.tmpl | 54 +++++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ad48b0..b0c9a0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,12 @@ jobs: python: "3.14" - platform: "ubuntu_24_04" python: "3" - - platform: "astralinux_1_7" + - platform: "altlinux_10" python: "3" - platform: "altlinux_11" python: "3" + - platform: "astralinux_1_7" + python: "3" env: BASE_SIGN: "${{ matrix.platform }}-py${{ matrix.python }}" diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 2359459..bfbbfaa 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -7,12 +7,13 @@ RUN apt-get update RUN apt-get install -y sudo curl ca-certificates RUN apt-get update RUN apt-get install -y openssh-server openssh-clients +RUN apt-get install -y sshpass RUN apt-get install -y time +RUN apt-get install -y su # RUN apt-get install -y mc EXPOSE 22 - RUN ssh-keygen -A # --------------------------------------------- dev_tools @@ -41,24 +42,45 @@ WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -USER test - -RUN chmod 700 ~/ -RUN mkdir -p ~/.ssh +RUN chmod 700 /home/test/ +RUN mkdir -p /home/test/.ssh +RUN chown -R test:test /home/test/.ssh # # Altlinux 10 and 11 too slowly create a new SSH connection (x6). # -ENTRYPOINT sh -c " \ +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + /usr/sbin/sshd; \ + ls -la /home/test/.ssh/; \ + \"$@\"; \ +"] + +# Run tests by default (master machine role) +CMD ["", "bash", "-c", " \ set -eux; \ -echo HELLO FROM ENTRYPOINT; \ -echo HOME DIR IS [`realpath ~/`]; \ -sudo /usr/sbin/sshd; \ -ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ -ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ -ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ -chmod 600 ~/.ssh/authorized_keys; \ -ls -la ~/.ssh/; \ -TEST_FILTER=\"\" bash ./run_tests3.sh;" +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\" test; \ + su -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\" test; \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ +su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +fi; \ +if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ +fi; \ +ls -la ./; \ +su - test -c \"cd /home/test/testgres && bash ./run_tests3.sh\"; \ +"] From 267891481829d5c923a1f51da9fb4fdc04e0ae13 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 19:38:57 +0300 Subject: [PATCH 26/66] CI: lint and build-check are restored --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0c9a0d..6cabf5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,59 @@ on: - "*.md" jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 flake8-pyproject ruff + - name: Lint with flake8 + run: | + flake8 . + - name: Lint with ruff + run: | + ruff check . + + build-check: + runs-on: ubuntu-latest + needs: lint + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Python 3.12 + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Build package + run: | + python -m build + + - name: Check package metadata + run: | + twine check dist/* + test: runs-on: ubuntu-latest + needs: build-check strategy: fail-fast: false matrix: From 7067c24df615520d85b064598c948b69fcd4726c Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 19:54:13 +0300 Subject: [PATCH 27/66] New test: test_prove_environment_isolation Author: Mark G. (mark@google.com). --- tests/test_os_ops_common.py | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/test_os_ops_common.py b/tests/test_os_ops_common.py index 764f3a2..4085940 100644 --- a/tests/test_os_ops_common.py +++ b/tests/test_os_ops_common.py @@ -2725,6 +2725,60 @@ def test_readlines__BIN( assert lines == result_bin return + def test_prove_environment_isolation( + self, + os_ops_descr: OsOpsDescr + ): + # + # Author: Marg G. (mark@google.com) + # + # It used as is. Without any changes. + # + + assert type(os_ops_descr) is OsOpsDescr + os_ops = os_ops_descr.os_ops + assert isinstance(os_ops, OsOperations) + + logging.info("=================== COKANUM PROOF START ===================") + logging.info(f"Target environment type: [{os_ops_descr.sign}]") + + # 1. Забираем OS-RELEASE + try: + # Используем cat, который мы уже проверили + os_release = os_ops.read("/etc/os-release") + # Вытаскиваем только PRETTY_NAME для компактности в логах + pretty_name = "Unknown Linux" + for line in os_release.splitlines(): + if line.startswith("PRETTY_NAME="): + pretty_name = line.split("=")[1].strip('"') + break + logging.info(f"OS Platform detected : {pretty_name}") + except Exception as e: + logging.error(f"Failed to read os-release: {e}") + + # 2. Забираем IP-адреса через 'ip route' или 'ip address' + # Чтобы не парсить гигантскую простыню ip addr, возьмем интерфейс, который смотрит наружу + try: + # awk у нас теперь работает как надо, так что забираем чистый IP + cmd = ["sh", "-c", "ip route get 1.1.1.1 | awk '{print $7; exit}'"] + ip_r = os_ops.exec_command(cmd, encoding="utf-8") + ip_clean = ip_r.strip() if isinstance(ip_r, str) else "unknown" + + # Если ip route пустой (например, нет внешнего интернета в контейнере), берем дефолтный ip addr + if not ip_clean: + cmd = ["sh", "-c", "ip address show eth0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1"] + ip_r = os_ops.exec_command(cmd, encoding="utf-8") + ip_clean = ip_r.strip() if isinstance(ip_r, str) else "unknown" + + logging.info(f"Machine IP Address : {ip_clean}") + except Exception as e: + logging.error(f"Failed to get IP address: {e}") + + logging.info("=================== COKANUM PROOF END =====================") + + # Тест всегда успешный, его цель — оставить исторический след в логах гитхаба + assert True + @staticmethod def helper__bug_check__unknown_os_ops_type( os_ops: OsOperations, From 23ac3731d39b935a60d0dcae0abbe462bf4e974c Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 20:08:02 +0300 Subject: [PATCH 28/66] rename: TEST_PARAM_xxx -> TEST_CFG_xxx --- .github/workflows/ci.yml | 6 +++--- Dockerfile--alpine.tmpl | 14 +++++++------- Dockerfile--altlinux_10.tmpl | 14 +++++++------- Dockerfile--altlinux_11.tmpl | 14 +++++++------- Dockerfile--astralinux_1_7.tmpl | 14 +++++++------- Dockerfile--ubuntu_24_04.tmpl | 14 +++++++------- tests/helpers/global_data.py | 8 ++++---- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cabf5b..ecf69a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,9 +154,9 @@ jobs: --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ - -e TEST_PARAM_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ - -e TEST_PARAM_REMOTE2_USERNAME="test" \ - -e TEST_PARAM_REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ + -e TEST_CFG_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ + -e TEST_CFG_REMOTE2_USERNAME="test" \ + -e TEST_CFG_REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" - name: Upload Logs diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 2c4d1ec..891ef61 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -67,14 +67,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index bfbbfaa..08d89f7 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -71,14 +71,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index b51682a..42cba1a 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -74,14 +74,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index 647e9a9..bbb060b 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -69,14 +69,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index b9824eb..57fe8dd 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -61,14 +61,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_PARAM_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_PARAM_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_PARAM_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_PARAM_REMOTE2_SSH_KEY}\" \"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_PARAM_REMOTE2_SSH_KEY=\"${TEST_PARAM_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_PARAM_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index f107711..ed8b333 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -19,10 +19,10 @@ def __init__(self, sign: str, os_ops: OsOperations): class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( - host=os.getenv('TEST_PARAM_REMOTE2_HOST') or '127.0.0.1', - username=os.getenv('TEST_PARAM_REMOTE2_USERNAME'), - ssh_key=os.getenv('TEST_PARAM_REMOTE2_SSH_KEY'), - password=os.getenv('TEST_PARAM_REMOTE2_PASSWORD'), + host=os.getenv('TEST_CFG_REMOTE2_HOST') or '127.0.0.1', + username=os.getenv('TEST_CFG_REMOTE2_USERNAME'), + ssh_key=os.getenv('TEST_CFG_REMOTE2_SSH_KEY'), + password=os.getenv('TEST_CFG_REMOTE2_PASSWORD'), ) sm_remote_os_ops = RemoteOperations(sm_remote_conn_params) From 775fc0869b6074e9066c97bdcb64dac885c5c351 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 20:30:40 +0300 Subject: [PATCH 29/66] New test parameter TEST_CFG_REMOTE2_PORT is added CI assign 22 to it. --- .github/workflows/ci.yml | 1 + tests/helpers/global_data.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecf69a8..ca16531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,6 +155,7 @@ jobs: -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ -e TEST_CFG_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ + -e TEST_CFG_REMOTE2_HOST="22" \ -e TEST_CFG_REMOTE2_USERNAME="test" \ -e TEST_CFG_REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index ed8b333..2752a58 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -20,6 +20,7 @@ def __init__(self, sign: str, os_ops: OsOperations): class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( host=os.getenv('TEST_CFG_REMOTE2_HOST') or '127.0.0.1', + port=int(os.getenv('TEST_CFG_REMOTE2_PORT', 0)) if os.getenv('TEST_CFG_REMOTE2_PORT') else None, username=os.getenv('TEST_CFG_REMOTE2_USERNAME'), ssh_key=os.getenv('TEST_CFG_REMOTE2_SSH_KEY'), password=os.getenv('TEST_CFG_REMOTE2_PASSWORD'), From 7343ce456545d483086096061bc813595c014d51 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 20:35:41 +0300 Subject: [PATCH 30/66] correction: TEST_CFG_xxx -> TEST_CFG__xxx (unification) --- .github/workflows/ci.yml | 8 ++++---- Dockerfile--alpine.tmpl | 14 +++++++------- Dockerfile--altlinux_10.tmpl | 14 +++++++------- Dockerfile--altlinux_11.tmpl | 14 +++++++------- Dockerfile--astralinux_1_7.tmpl | 14 +++++++------- Dockerfile--ubuntu_24_04.tmpl | 14 +++++++------- tests/helpers/global_data.py | 10 +++++----- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca16531..bbc4e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,10 +154,10 @@ jobs: --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ - -e TEST_CFG_REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ - -e TEST_CFG_REMOTE2_HOST="22" \ - -e TEST_CFG_REMOTE2_USERNAME="test" \ - -e TEST_CFG_REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ + -e TEST_CFG__REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ + -e TEST_CFG__REMOTE2_HOST="22" \ + -e TEST_CFG__REMOTE2_USERNAME="test" \ + -e TEST_CFG__REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" - name: Upload Logs diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 891ef61..7d7f590 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -67,14 +67,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 08d89f7..5d8cf74 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -71,14 +71,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index 42cba1a..ba2d515 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -74,14 +74,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index bbb060b..4e2a519 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -69,14 +69,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index 57fe8dd..c4d8ec1 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -61,14 +61,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG_REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG_REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG_REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG_REMOTE2_SSH_KEY}\" \"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG_REMOTE2_SSH_KEY=\"${TEST_CFG_REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG_REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index 2752a58..3de9d82 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -19,11 +19,11 @@ def __init__(self, sign: str, os_ops: OsOperations): class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( - host=os.getenv('TEST_CFG_REMOTE2_HOST') or '127.0.0.1', - port=int(os.getenv('TEST_CFG_REMOTE2_PORT', 0)) if os.getenv('TEST_CFG_REMOTE2_PORT') else None, - username=os.getenv('TEST_CFG_REMOTE2_USERNAME'), - ssh_key=os.getenv('TEST_CFG_REMOTE2_SSH_KEY'), - password=os.getenv('TEST_CFG_REMOTE2_PASSWORD'), + host=os.getenv('TEST_CFG__REMOTE2_HOST') or '127.0.0.1', + port=int(os.getenv('TEST_CFG__REMOTE2_PORT', 0)) if os.getenv('TEST_CFG__REMOTE2_PORT') else None, + username=os.getenv('TEST_CFG__REMOTE2_USERNAME'), + ssh_key=os.getenv('TEST_CFG__REMOTE2_SSH_KEY'), + password=os.getenv('TEST_CFG__REMOTE2_PASSWORD'), ) sm_remote_os_ops = RemoteOperations(sm_remote_conn_params) From 1faf3bdc86bf68cf1fa2b92ca4edcac673dbccae Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 20:44:33 +0300 Subject: [PATCH 31/66] CI: (fix) TEST_CFG__REMOTE2_PORT=22 (not TEST_CFG__REMOTE2_HOST) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbc4e25..46a82da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,7 +155,7 @@ jobs: -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ -e TEST_CFG__REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ - -e TEST_CFG__REMOTE2_HOST="22" \ + -e TEST_CFG__REMOTE2_PORT="22" \ -e TEST_CFG__REMOTE2_USERNAME="test" \ -e TEST_CFG__REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" From 40041c65507ee657bfad816cbb30df3527be3c34 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 21:03:21 +0300 Subject: [PATCH 32/66] correction: TEST_CFG__REMOTE2_ --> TEST_CFG__REMOTE_ "remote2" was old and not good idea. --- .github/workflows/ci.yml | 8 ++++---- Dockerfile--alpine.tmpl | 14 +++++++------- Dockerfile--altlinux_10.tmpl | 14 +++++++------- Dockerfile--altlinux_11.tmpl | 14 +++++++------- Dockerfile--astralinux_1_7.tmpl | 14 +++++++------- Dockerfile--ubuntu_24_04.tmpl | 14 +++++++------- tests/helpers/global_data.py | 10 +++++----- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46a82da..54214b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,10 +154,10 @@ jobs: --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ - -e TEST_CFG__REMOTE2_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ - -e TEST_CFG__REMOTE2_PORT="22" \ - -e TEST_CFG__REMOTE2_USERNAME="test" \ - -e TEST_CFG__REMOTE2_SSH_KEY="/home/test/testgres/id_ed25519_test" \ + -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ + -e TEST_CFG__REMOTE_PORT="22" \ + -e TEST_CFG__REMOTE_USERNAME="test" \ + -e TEST_CFG__REMOTE_SSH_KEY="/home/test/testgres/id_ed25519_test" \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" - name: Upload Logs diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 7d7f590..ff02d36 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -67,14 +67,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 5d8cf74..623c3cc 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -71,14 +71,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index ba2d515..def9f0e 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -74,14 +74,14 @@ fi; \ ls -la /home/test/.ssh/; \ su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\" test; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \ fi; \ -if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index 4e2a519..8b1f47e 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -69,14 +69,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index c4d8ec1..ae8e4f9 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -61,14 +61,14 @@ fi; \ ls -la /home/test/.ssh/; \ su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE2_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE2_HOST} >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ fi; \ -if [ -n \"${TEST_CFG__REMOTE2_SSH_KEY:-}\" ]; then \ - cp \"${TEST_CFG__REMOTE2_SSH_KEY}\" \"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - export TEST_CFG__REMOTE2_SSH_KEY=\"${TEST_CFG__REMOTE2_SSH_KEY}_ci\"; \ - chown test:test \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ - chmod 600 \"${TEST_CFG__REMOTE2_SSH_KEY}\"; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index 3de9d82..ffa0103 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -19,11 +19,11 @@ def __init__(self, sign: str, os_ops: OsOperations): class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( - host=os.getenv('TEST_CFG__REMOTE2_HOST') or '127.0.0.1', - port=int(os.getenv('TEST_CFG__REMOTE2_PORT', 0)) if os.getenv('TEST_CFG__REMOTE2_PORT') else None, - username=os.getenv('TEST_CFG__REMOTE2_USERNAME'), - ssh_key=os.getenv('TEST_CFG__REMOTE2_SSH_KEY'), - password=os.getenv('TEST_CFG__REMOTE2_PASSWORD'), + host=os.getenv('TEST_CFG__REMOTE_HOST') or '127.0.0.1', + port=int(os.getenv('TEST_CFG__REMOTE_PORT', 0)) if os.getenv('TEST_CFG__REMOTE_PORT') else None, + username=os.getenv('TEST_CFG__REMOTE_USERNAME'), + ssh_key=os.getenv('TEST_CFG__REMOTE_SSH_KEY'), + password=os.getenv('TEST_CFG__REMOTE_PASSWORD'), ) sm_remote_os_ops = RemoteOperations(sm_remote_conn_params) From 4f658d2808ab16c142e15da1e07660b4394fdaee Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 21:07:15 +0300 Subject: [PATCH 33/66] CI: ci.yml is updated (remote2 -> remote) --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54214b7..061c6cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: echo "RUN_CFG__NOW=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV - echo "RUN_CFG__REMOTE2_NAME=remote2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__REMOTE_NAME=remote2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" cat $GITHUB_ENV @@ -124,16 +124,16 @@ jobs: # Generate a key without a password directly on the GitHub Actions host ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} - - name: Run second target host (remote2) + - name: Run second target host (for remote operations) run: | - docker run -d -t --name ${{ env.RUN_CFG__REMOTE2_NAME }} \ + docker run -d -t --name ${{ env.RUN_CFG__REMOTE_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/.ssh/authorized_keys_ci:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity sleep 1.0 - docker exec -u root ${{ env.RUN_CFG__REMOTE2_NAME }} sh -c " + docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ echo '---' && \ @@ -151,10 +151,10 @@ jobs: # Pass environment variables so Python tests know where to start. # Link the containers using --link so the name "remote2" resolves to an IP address. docker run -t \ - --link ${{ env.RUN_CFG__REMOTE2_NAME }}:${{ env.RUN_CFG__REMOTE2_NAME }} \ + --link ${{ env.RUN_CFG__REMOTE_NAME }}:${{ env.RUN_CFG__REMOTE_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ - -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__REMOTE2_NAME }}" \ + -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__REMOTE_NAME }}" \ -e TEST_CFG__REMOTE_PORT="22" \ -e TEST_CFG__REMOTE_USERNAME="test" \ -e TEST_CFG__REMOTE_SSH_KEY="/home/test/testgres/id_ed25519_test" \ From a3eab07ac9bae05fc63a2e0736d0dfb4032e5e7c Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Fri, 3 Jul 2026 21:28:40 +0300 Subject: [PATCH 34/66] English --- tests/test_os_ops_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_os_ops_common.py b/tests/test_os_ops_common.py index 4085940..01c56a5 100644 --- a/tests/test_os_ops_common.py +++ b/tests/test_os_ops_common.py @@ -2732,7 +2732,7 @@ def test_prove_environment_isolation( # # Author: Marg G. (mark@google.com) # - # It used as is. Without any changes. + # It is used as is, without any modifications. # assert type(os_ops_descr) is OsOpsDescr From f962fece5292e6d70cbf9ae7b378df837e5d32f4 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 18:58:42 +0300 Subject: [PATCH 35/66] OsOpsDescrs is updated - it uses _to_int_or_none - it os.getenv('TEST_CFG__REMOTE_HOST', '127.0.0.1') --- tests/helpers/global_data.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/helpers/global_data.py b/tests/helpers/global_data.py index ffa0103..16032bd 100644 --- a/tests/helpers/global_data.py +++ b/tests/helpers/global_data.py @@ -4,6 +4,7 @@ from src.remote_ops import RemoteOperations import os +import typing class OsOpsDescr: @@ -17,10 +18,14 @@ def __init__(self, sign: str, os_ops: OsOperations): self.os_ops = os_ops +def _to_int_or_none(v: typing.Any) -> typing.Optional[int]: + return v if v is None else int(v) + + class OsOpsDescrs: sm_remote_conn_params = ConnectionParams( - host=os.getenv('TEST_CFG__REMOTE_HOST') or '127.0.0.1', - port=int(os.getenv('TEST_CFG__REMOTE_PORT', 0)) if os.getenv('TEST_CFG__REMOTE_PORT') else None, + host=os.getenv('TEST_CFG__REMOTE_HOST', '127.0.0.1'), + port=_to_int_or_none(os.getenv('TEST_CFG__REMOTE_PORT')), username=os.getenv('TEST_CFG__REMOTE_USERNAME'), ssh_key=os.getenv('TEST_CFG__REMOTE_SSH_KEY'), password=os.getenv('TEST_CFG__REMOTE_PASSWORD'), From 41a1d55996f5f3132aea2a5bf25637270852934e Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 18:59:39 +0300 Subject: [PATCH 36/66] run_tests3.sh prints values of "TEST_CFG__xxx" --- run_tests3.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_tests3.sh b/run_tests3.sh index af70f5e..1723a8f 100755 --- a/run_tests3.sh +++ b/run_tests3.sh @@ -10,6 +10,8 @@ source "${VENV_PATH}/bin/activate" pip install --upgrade pip setuptools wheel python3 -m pip install -r tests/requirements.txt +export -p | grep "TEST_CFG__" + # run builtin tests python3 -m pytest -l -vvv -n 4 From f58a6d68730cb4466d644b9791f29191af5f18af Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 19:19:09 +0300 Subject: [PATCH 37/66] run_tests3.sh prints ALL envs --- run_tests3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests3.sh b/run_tests3.sh index 1723a8f..339340e 100755 --- a/run_tests3.sh +++ b/run_tests3.sh @@ -10,7 +10,7 @@ source "${VENV_PATH}/bin/activate" pip install --upgrade pip setuptools wheel python3 -m pip install -r tests/requirements.txt -export -p | grep "TEST_CFG__" +export -p # run builtin tests python3 -m pytest -l -vvv -n 4 From 55d4818404f28d51a4cdcbf45e9a4684c640e3ba Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 20:51:36 +0300 Subject: [PATCH 38/66] fix: altlinux ran all the tests on the one machine We have to transfter TEST_CFG__ parameters to "su - test -c ..." command explicitly. --- Dockerfile--altlinux_10.tmpl | 7 ++++++- Dockerfile--altlinux_11.tmpl | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 623c3cc..8ac79cc 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -82,5 +82,10 @@ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ -su - test -c \"cd /home/test/testgres && bash ./run_tests3.sh\"; \ +# AUTOMATIC TRANSFER: Save all TEST_CFG__ variables to a temporary file \ +(env | grep '^TEST_CFG__' | sed 's/^/export /' || echo '') > ./test_cfg_env.sh; \ +chown test:test ./test_cfg_env.sh; \ +cat ./test_cfg_env.sh; \ +# Run su -, pull in the file with variables and start the tests \ +su - test -c \"cd /home/test/testgres && source ./test_cfg_env.sh && bash ./run_tests3.sh\"; \ "] diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index def9f0e..703543f 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -85,5 +85,10 @@ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ -su - test -c \"cd /home/test/testgres && bash ./run_tests3.sh\"; \ +# AUTOMATIC TRANSFER: Save all TEST_CFG__ variables to a temporary file \ +(env | grep '^TEST_CFG__' | sed 's/^/export /' || echo '') > ./test_cfg_env.sh; \ +chown test:test ./test_cfg_env.sh; \ +cat ./test_cfg_env.sh; \ +# Run su -, pull in the file with variables and start the tests \ +su - test -c \"cd /home/test/testgres && source ./test_cfg_env.sh && bash ./run_tests3.sh\"; \ "] From ab2ea3db2cc3d86e67474f3bd126b2a77a4df705 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 21:34:19 +0300 Subject: [PATCH 39/66] test_prove_environment_isolation is updated --- tests/test_os_ops_common.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tests/test_os_ops_common.py b/tests/test_os_ops_common.py index 01c56a5..513dcff 100644 --- a/tests/test_os_ops_common.py +++ b/tests/test_os_ops_common.py @@ -2732,8 +2732,6 @@ def test_prove_environment_isolation( # # Author: Marg G. (mark@google.com) # - # It is used as is, without any modifications. - # assert type(os_ops_descr) is OsOpsDescr os_ops = os_ops_descr.os_ops @@ -2746,6 +2744,7 @@ def test_prove_environment_isolation( try: # Используем cat, который мы уже проверили os_release = os_ops.read("/etc/os-release") + assert type(os_release) is str # Вытаскиваем только PRETTY_NAME для компактности в логах pretty_name = "Unknown Linux" for line in os_release.splitlines(): @@ -2756,23 +2755,17 @@ def test_prove_environment_isolation( except Exception as e: logging.error(f"Failed to read os-release: {e}") - # 2. Забираем IP-адреса через 'ip route' или 'ip address' - # Чтобы не парсить гигантскую простыню ip addr, возьмем интерфейс, который смотрит наружу + # 2. Просто выводим сетевой ландшафт "как есть" и не паримся! try: - # awk у нас теперь работает как надо, так что забираем чистый IP - cmd = ["sh", "-c", "ip route get 1.1.1.1 | awk '{print $7; exit}'"] - ip_r = os_ops.exec_command(cmd, encoding="utf-8") - ip_clean = ip_r.strip() if isinstance(ip_r, str) else "unknown" - - # Если ip route пустой (например, нет внешнего интернета в контейнере), берем дефолтный ip addr - if not ip_clean: - cmd = ["sh", "-c", "ip address show eth0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1"] - ip_r = os_ops.exec_command(cmd, encoding="utf-8") - ip_clean = ip_r.strip() if isinstance(ip_r, str) else "unknown" - - logging.info(f"Machine IP Address : {ip_clean}") + cmd = ["ip", "address"] + ip_output = os_ops.exec_command(cmd, encoding="utf-8") + assert type(ip_output) is str + logging.info("Network interfaces info:") + # Печатаем всю простыню целиком, добавив отступы для красоты + for line in ip_output.splitlines(): + logging.info(f" {line}") except Exception as e: - logging.error(f"Failed to get IP address: {e}") + logging.error(f"Failed to get ip address output: {e}") logging.info("=================== COKANUM PROOF END =====================") From 02f6762b80cdf23cb21d83d2e98df13b85f23125 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 22:10:54 +0300 Subject: [PATCH 40/66] fix: ubuntu and astralinux are installing iproute2 package to get a 'ip' utility. --- Dockerfile--astralinux_1_7.tmpl | 3 +++ Dockerfile--ubuntu_24_04.tmpl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index 8b1f47e..b31bbec 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -11,6 +11,9 @@ RUN apt install -y sshpass # RUN apt install -y time # RUN apt install -y netcat-traditional +# it installs "ip" utility +RUN apt install -y iproute2 + RUN apt install -y git # RUN apt install -y mc diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index ae8e4f9..18f98c4 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -11,6 +11,9 @@ RUN apt install -y sshpass RUN apt install -y time RUN apt install -y netcat-traditional +# it installs "ip" utility +RUN apt install -y iproute2 + RUN apt install -y git # RUN apt install -y mc From 6c8b40a9b14ba08e7395224575255ccc4e16c39a Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 4 Jul 2026 22:33:56 +0300 Subject: [PATCH 41/66] test_prove_environment_isolation is updated --- tests/test_os_ops_common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_os_ops_common.py b/tests/test_os_ops_common.py index 513dcff..4f326ca 100644 --- a/tests/test_os_ops_common.py +++ b/tests/test_os_ops_common.py @@ -2771,6 +2771,7 @@ def test_prove_environment_isolation( # Тест всегда успешный, его цель — оставить исторический след в логах гитхаба assert True + return @staticmethod def helper__bug_check__unknown_os_ops_type( From 04d55843feebb337368f5d94ca067df4267c5fd7 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 09:37:30 +0300 Subject: [PATCH 42/66] CI: A work with id_ed25519_test.pub is improved We link it into /home/test/testgres/id_ed25519_test.pub After that we copy it to /home/test/.ssh/authorized_keys --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 061c6cb..fda27fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,17 +127,20 @@ jobs: - name: Run second target host (for remote operations) run: | docker run -d -t --name ${{ env.RUN_CFG__REMOTE_NAME }} \ - -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/.ssh/authorized_keys_ci:ro \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/testgres/id_ed25519_test.pub:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity sleep 1.0 + # + # We will COPY (not APPEND) id_ed25519_test.pub into/home/test/.ssh/authorized_keys + # docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ echo '---' && \ - cp /home/test/.ssh/authorized_keys_ci /home/test/.ssh/authorized_keys && \ + cp /home/test/testgres/id_ed25519_test.pub /home/test/.ssh/authorized_keys && \ chown test.test /home/test/.ssh/authorized_keys && \ chmod 600 /home/test/.ssh/authorized_keys && \ chmod 700 /home/test/.ssh && \ From aa8a894797249d17230bf7ff1c07c2bb679dfc4b Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 11:03:44 +0300 Subject: [PATCH 43/66] CI: [fix] test:test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fda27fb..47a4468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: cat /etc/os-release && \ echo '---' && \ cp /home/test/testgres/id_ed25519_test.pub /home/test/.ssh/authorized_keys && \ - chown test.test /home/test/.ssh/authorized_keys && \ + chown test:test /home/test/.ssh/authorized_keys && \ chmod 600 /home/test/.ssh/authorized_keys && \ chmod 700 /home/test/.ssh && \ echo '--- INSIDE CONTAINER .SSH ---' && \ From 526282f85aba9f7941ab5a37ac8234be944b09fc Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 11:28:43 +0300 Subject: [PATCH 44/66] CI: (remote2) map xxx.pub (600) to /home/test/.ssh/authorized_keys --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47a4468..cc77b80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,11 +123,12 @@ jobs: run: | # Generate a key without a password directly on the GitHub Actions host ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} + chmod 600 ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub - name: Run second target host (for remote operations) run: | docker run -d -t --name ${{ env.RUN_CFG__REMOTE_NAME }} \ - -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/testgres/id_ed25519_test.pub:ro \ + -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/.ssh/authorized_keys:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity @@ -139,11 +140,6 @@ jobs: docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ - echo '---' && \ - cp /home/test/testgres/id_ed25519_test.pub /home/test/.ssh/authorized_keys && \ - chown test:test /home/test/.ssh/authorized_keys && \ - chmod 600 /home/test/.ssh/authorized_keys && \ - chmod 700 /home/test/.ssh && \ echo '--- INSIDE CONTAINER .SSH ---' && \ ls -la /home/test/.ssh/ " From a62c1cb67e374fa45aa492292791c00f59825e01 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 12:03:42 +0300 Subject: [PATCH 45/66] CI: (remote2) setup authorized_keys via conveyor --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc77b80..dba5789 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,20 +123,24 @@ jobs: run: | # Generate a key without a password directly on the GitHub Actions host ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} - chmod 600 ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub - name: Run second target host (for remote operations) run: | docker run -d -t --name ${{ env.RUN_CFG__REMOTE_NAME }} \ - -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub:/home/test/.ssh/authorized_keys:ro \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity sleep 1.0 # - # We will COPY (not APPEND) id_ed25519_test.pub into/home/test/.ssh/authorized_keys + # Setup authorized_keys # + cat ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub | \ + docker exec -i -u test ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " \ + cat >> /home/test/.ssh/authorized_keys && \ + chmod 600 /home/test/.ssh/authorized_keys \ + " + docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ From 721682e3eb116b40c4d7616191f3db3846b6f76f Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 12:11:23 +0300 Subject: [PATCH 46/66] CI: "INSIDE CONTAINER .SSH" is corrected --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dba5789..3f7add6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,11 +141,14 @@ jobs: chmod 600 /home/test/.ssh/authorized_keys \ " + # + # Log status + # docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ echo '--- INSIDE CONTAINER .SSH ---' && \ - ls -la /home/test/.ssh/ + ls -la /home/test/.ssh/ \ " - name: Run Main Test Container From e3ce285928024f705237345d59bea4e3785561cb Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 13:12:54 +0300 Subject: [PATCH 47/66] CI: comments are corrected (altlinux) --- Dockerfile--altlinux_10.tmpl | 2 +- Dockerfile--altlinux_11.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 8ac79cc..f81639f 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -82,7 +82,7 @@ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ -# AUTOMATIC TRANSFER: Save all TEST_CFG__ variables to a temporary file \ +# AUTOMATIC TRANSFER: Save all TEST_CFG__xxx variables to a temporary file \ (env | grep '^TEST_CFG__' | sed 's/^/export /' || echo '') > ./test_cfg_env.sh; \ chown test:test ./test_cfg_env.sh; \ cat ./test_cfg_env.sh; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index 703543f..debde74 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -85,7 +85,7 @@ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ ls -la /home/test/.ssh/; \ fi; \ ls -la ./; \ -# AUTOMATIC TRANSFER: Save all TEST_CFG__ variables to a temporary file \ +# AUTOMATIC TRANSFER: Save all TEST_CFG__xxx variables to a temporary file \ (env | grep '^TEST_CFG__' | sed 's/^/export /' || echo '') > ./test_cfg_env.sh; \ chown test:test ./test_cfg_env.sh; \ cat ./test_cfg_env.sh; \ From 2a0b22a124ca6d240fe40f897fe502054829772d Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 13:29:41 +0300 Subject: [PATCH 48/66] CI: RUN_CFG__REMOTE_NAME -> RUN_CFG__MACHINE2_NAME --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f7add6..c9ae5ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: echo "RUN_CFG__NOW=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV - echo "RUN_CFG__REMOTE_NAME=remote2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__MACHINE2_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" cat $GITHUB_ENV @@ -126,7 +126,7 @@ jobs: - name: Run second target host (for remote operations) run: | - docker run -d -t --name ${{ env.RUN_CFG__REMOTE_NAME }} \ + docker run -d -t --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity @@ -136,7 +136,7 @@ jobs: # Setup authorized_keys # cat ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub | \ - docker exec -i -u test ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " \ + docker exec -i -u test ${{ env.RUN_CFG__MACHINE2_NAME }} sh -c " \ cat >> /home/test/.ssh/authorized_keys && \ chmod 600 /home/test/.ssh/authorized_keys \ " @@ -144,7 +144,7 @@ jobs: # # Log status # - docker exec -u root ${{ env.RUN_CFG__REMOTE_NAME }} sh -c " + docker exec -u root ${{ env.RUN_CFG__MACHINE2_NAME }} sh -c " echo '--- INSIDE CONTAINER OS ---' && \ cat /etc/os-release && \ echo '--- INSIDE CONTAINER .SSH ---' && \ @@ -155,12 +155,12 @@ jobs: run: | # Launch the main container, passing the private key to the .ssh folder of the test user. # Pass environment variables so Python tests know where to start. - # Link the containers using --link so the name "remote2" resolves to an IP address. + # Link the containers using --link so the name "machine2" resolves to an IP address. docker run -t \ - --link ${{ env.RUN_CFG__REMOTE_NAME }}:${{ env.RUN_CFG__REMOTE_NAME }} \ + --link ${{ env.RUN_CFG__MACHINE2_NAME }}:${{ env.RUN_CFG__MACHINE2_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ - -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__REMOTE_NAME }}" \ + -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__MACHINE2_NAME }}" \ -e TEST_CFG__REMOTE_PORT="22" \ -e TEST_CFG__REMOTE_USERNAME="test" \ -e TEST_CFG__REMOTE_SSH_KEY="/home/test/testgres/id_ed25519_test" \ From 682f750f84fc149ae46b21eec3ec9a41bdf99756 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 14:28:09 +0300 Subject: [PATCH 49/66] CI: docker network is used --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9ae5ea..f821436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,7 @@ jobs: echo "RUN_CFG__NOW=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__NETWORK_NAME=network-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__MACHINE2_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" @@ -124,9 +125,15 @@ jobs: # Generate a key without a password directly on the GitHub Actions host ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} + - name: Setup network + run: | + docker network create ${{ env.RUN_CFG__NETWORK_NAME }} + - name: Run second target host (for remote operations) run: | - docker run -d -t --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ + docker run -d -t \ + --network ${{ env.RUN_CFG__NETWORK_NAME }} \ + --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity @@ -155,9 +162,8 @@ jobs: run: | # Launch the main container, passing the private key to the .ssh folder of the test user. # Pass environment variables so Python tests know where to start. - # Link the containers using --link so the name "machine2" resolves to an IP address. docker run -t \ - --link ${{ env.RUN_CFG__MACHINE2_NAME }}:${{ env.RUN_CFG__MACHINE2_NAME }} \ + --network ${{ env.RUN_CFG__NETWORK_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__MACHINE2_NAME }}" \ From e9e8b4ebb1005c8c7aec0be7aca0ecea18c6d984 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 14:54:48 +0300 Subject: [PATCH 50/66] CI: step names are updated (machine1, machine2) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f821436..07861ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: run: | docker network create ${{ env.RUN_CFG__NETWORK_NAME }} - - name: Run second target host (for remote operations) + - name: Run machine2 (for remote operations) run: | docker run -d -t \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ @@ -158,7 +158,7 @@ jobs: ls -la /home/test/.ssh/ \ " - - name: Run Main Test Container + - name: Run machine1 (main test container) run: | # Launch the main container, passing the private key to the .ssh folder of the test user. # Pass environment variables so Python tests know where to start. From dcd51e212bb7d08b89ec45e79e5e1e53651504fc Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 15:22:17 +0300 Subject: [PATCH 51/66] CI: Cleanup Docker resources --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07861ac..967c684 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,8 @@ jobs: run: | # Launch the main container, passing the private key to the .ssh folder of the test user. # Pass environment variables so Python tests know where to start. - docker run -t \ + # Added the --rm flag so that the container is automatically deleted after the tests are completed + docker run --rm -t \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ @@ -178,3 +179,12 @@ jobs: with: name: testgres.os_ops--test_logs--${{ env.RUN_CFG__NOW }}-${{ env.BASE_SIGN }}-id${{ github.run_id }} path: "${{ env.RUN_CFG__LOGS_DIR }}/" + + - name: Cleanup Docker resources + if: always() # Ensures that the step is executed regardless of the result of the task + run: | + echo "=== Garbage Collection ===" + # Force kill the background machine (the -f flag will stop it if it is running) + docker rm -f "${{ env.RUN_CFG__MACHINE2_NAME }}" || true + # Delete the network (it will be deleted successfully, since all containers in it have already been destroyed) + docker network rm "${{ env.RUN_CFG__NETWORK_NAME }}" || true From 1d54b83a492ed870fd0b5cc3d0b2dd21b0cdbd25 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:04:35 +0300 Subject: [PATCH 52/66] CI: (machine2) we will use "docker container inspect" instead sleep 1.0 --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 967c684..6cc5e24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,22 @@ jobs: "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity - sleep 1.0 + echo "Waiting for container ${{ env.RUN_CFG__MACHINE2_NAME }} to start ..." + + # Set the timeout using the attempt counter + MAX_ATTEMPTS=50 + ATTEMPT=0 + + until [ "$(docker container inspect --format '{{.State.Running}}' "${{ env.RUN_CFG__MACHINE2_NAME }}")" = "true" ]; do + ATTEMPT=$((ATTEMPT + 1)) + if [ $ATTEMPT -ge $MAX_ATTEMPTS ]; then + echo "Error: Container did not start within the allotted time (timeout)!" + exit 1 + fi + sleep 0.2 + done + + echo "Container successfully launched in $((ATTEMPT * 2 / 10)) second(s)!" # # Setup authorized_keys From cd36790aa616d8a031a80aa4b6ec58a96a621581 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:22:28 +0300 Subject: [PATCH 53/66] CI: lint and build-check use pip-cache --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cc5e24..1ef4f60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -51,6 +52,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: "3.12" + cache: 'pip' - name: Install build tools run: | From 33770decab0173f41df57beb1cec504289564de2 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:37:01 +0300 Subject: [PATCH 54/66] CI: ssh-keygen is called in quiet mode (-q) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ef4f60..0520ffb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,7 +125,7 @@ jobs: - name: Generate temporary SSH Key pair for CI run: | # Generate a key without a password directly on the GitHub Actions host - ssh-keygen -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} + ssh-keygen -q -t ed25519 -N "" -f ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }} - name: Setup network run: | From 04d1cbcaef9043b741d8299a90dd8f99b0c99513 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:42:29 +0300 Subject: [PATCH 55/66] CI: RUN_CFG__MACHINE1_NAME is added --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0520ffb..6724ec4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,7 @@ jobs: echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__NETWORK_NAME=network-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__MACHINE1_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__MACHINE2_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" @@ -182,6 +183,7 @@ jobs: # Added the --rm flag so that the container is automatically deleted after the tests are completed docker run --rm -t \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ + --name ${{ env.RUN_CFG__MACHINE1_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ -v ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}:/home/test/testgres/id_ed25519_test:ro \ -e TEST_CFG__REMOTE_HOST="${{ env.RUN_CFG__MACHINE2_NAME }}" \ From bd891dfafb03bbb874cb61a6d5f22a339e141a03 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:43:47 +0300 Subject: [PATCH 56/66] CI: Formatting --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6724ec4..f9d0f27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,8 +135,8 @@ jobs: - name: Run machine2 (for remote operations) run: | docker run -d -t \ - --network ${{ env.RUN_CFG__NETWORK_NAME }} \ - --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ + --network ${{ env.RUN_CFG__NETWORK_NAME }} \ + --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - sleep infinity From 1da98f7b96381d292a67b7a100af94e30e02eb71 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:46:08 +0300 Subject: [PATCH 57/66] CI: Comment on "-" in "- sleep infinity" --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d0f27..d4fddf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,9 @@ jobs: - name: Run machine2 (for remote operations) run: | + # + # "- sleep infinity" is a right command. Docker ignores "-" and runs "sleep infinity". + # docker run -d -t \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ From 26f778c7ecbca40f0e972a83a86191791e8ba546 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 16:49:51 +0300 Subject: [PATCH 58/66] CI: RUN_CFG__MACHINE1_NAME is fixed --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4fddf2..0c9d98f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__NETWORK_NAME=network-${{ env.BASE_SIGN }}" >> $GITHUB_ENV - echo "RUN_CFG__MACHINE1_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV + echo "RUN_CFG__MACHINE1_NAME=machine1-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__MACHINE2_NAME=machine2-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "RUN_CFG__SSH_KEY_NAME=id_ed25519-${{ env.BASE_SIGN }}" >> $GITHUB_ENV echo "---------- [$GITHUB_ENV]" From 41cde6dc427b9fd65f8554a43c93cbb3fcc2bf57 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 18:25:42 +0300 Subject: [PATCH 59/66] CI: ENTRYPOINT is fixed (DUMMY-DUMMY-DUMMY) --- .github/workflows/ci.yml | 2 +- Dockerfile--alpine.tmpl | 11 ++++++++--- Dockerfile--altlinux_10.tmpl | 11 ++++++++--- Dockerfile--altlinux_11.tmpl | 11 ++++++++--- Dockerfile--astralinux_1_7.tmpl | 11 ++++++++--- Dockerfile--ubuntu_24_04.tmpl | 11 ++++++++--- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c9d98f..39c5c9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: --network ${{ env.RUN_CFG__NETWORK_NAME }} \ --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ - - sleep infinity + sleep infinity echo "Waiting for container ${{ env.RUN_CFG__MACHINE2_NAME }} to start ..." diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index ff02d36..c40299b 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -46,16 +46,21 @@ RUN chmod 700 /home/test/ RUN mkdir -p /home/test/.ssh RUN chown -R test:test /home/test/.ssh +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ /usr/sbin/sshd; \ ls -la /home/test/.ssh/; \ - \"$@\"; \ -"] + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] # Run tests by default (master machine role) -CMD ["", "bash", "-c", " \ +CMD ["bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index f81639f..3f4908e 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -50,16 +50,21 @@ RUN chown -R test:test /home/test/.ssh # Altlinux 10 and 11 too slowly create a new SSH connection (x6). # +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ /usr/sbin/sshd; \ ls -la /home/test/.ssh/; \ - \"$@\"; \ -"] + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] # Run tests by default (master machine role) -CMD ["", "bash", "-c", " \ +CMD ["bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index debde74..44edfe3 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -53,16 +53,21 @@ RUN chown -R test:test /home/test/.ssh # Altlinux 10 and 11 too slowly create a new SSH connection (x6). # +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ /usr/sbin/sshd; \ ls -la /home/test/.ssh/; \ - \"$@\"; \ -"] + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] # Run tests by default (master machine role) -CMD ["", "bash", "-c", " \ +CMD ["bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index b31bbec..851c9b1 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -51,16 +51,21 @@ RUN chmod 700 /home/test/ RUN mkdir -p /home/test/.ssh RUN chown -R test:test /home/test/.ssh +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ service ssh start; \ ls -la /home/test/.ssh/; \ - \"$@\"; \ -"] + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] # Run tests by default (master machine role) -CMD ["", "bash", "-c", " \ +CMD ["bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index 18f98c4..ebdfbd5 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -43,16 +43,21 @@ RUN chmod 700 /home/test/ RUN mkdir -p /home/test/.ssh RUN chown -R test:test /home/test/.ssh +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ service ssh start; \ ls -la /home/test/.ssh/; \ - \"$@\"; \ -"] + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] # Run tests by default (master machine role) -CMD ["", "bash", "-c", " \ +CMD ["bash", "-c", " \ set -eux; \ echo \"HOME DIR IS [`realpath ~/`]\"; \ echo \"WORK DIR IS [$(pwd)]\"; \ From 9b3c56f4a7648336dbfa722885b06bc458f31889 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 18:56:11 +0300 Subject: [PATCH 60/66] CI: Dockerfile--ubuntu_24_04 is optimized --- Dockerfile--ubuntu_24_04.tmpl | 36 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index ebdfbd5..2a6ebb4 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -3,24 +3,30 @@ ARG PYTHON_VERSION=3 # --------------------------------------------- base1 FROM ubuntu:24.04 AS base1 -RUN apt update -RUN apt install -y sudo curl ca-certificates -RUN apt update -RUN apt install -y openssh-server -RUN apt install -y sshpass -RUN apt install -y time -RUN apt install -y netcat-traditional +# Disable interactive apt questions so that the build doesn't hang when setting time zones +ENV DEBIAN_FRONTEND=noninteractive -# it installs "ip" utility -RUN apt install -y iproute2 - -RUN apt install -y git - -# RUN apt install -y mc +RUN apt-get update && apt-get install -y --no-install-recommends \ + sudo \ + curl \ + ca-certificates \ + openssh-server \ + sshpass \ + time \ + netcat-traditional \ + iproute2 \ + git \ + && rm -rf /var/lib/apt/lists/* # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 -RUN apt install -y python3 python3-dev python3-venv + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 \ + python3-dev \ + python3-venv \ + && rm -rf /var/lib/apt/lists/* + ENV PYTHON_VERSION=3 # --------------------------------------------- final @@ -34,7 +40,7 @@ RUN useradd -m test # It enables execution of "sudo service ssh start" without password RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers -ADD --chown=test:test . /home/test/testgres +COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres ENV LANG=C.UTF-8 From b2826445f6b48376957755eaca66eab23b6bb92e Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 18:57:35 +0300 Subject: [PATCH 61/66] CI: Dockerfile--alpine uses COPY (not ADD) --- Dockerfile--alpine.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index c40299b..aa764cc 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -33,7 +33,7 @@ RUN adduser test sudo EXPOSE 22 RUN ssh-keygen -A -ADD --chown=test:test . /home/test/testgres +COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres # It allows to use sudo without password From 9af44f614d69877f9bcdb1c082ea27e4323a739e Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 19:12:21 +0300 Subject: [PATCH 62/66] CI: Dockerfile--ubuntu_24_04 is optimized (2) --- Dockerfile--ubuntu_24_04.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index 2a6ebb4..1f46d01 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -45,9 +45,9 @@ WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -RUN chmod 700 /home/test/ -RUN mkdir -p /home/test/.ssh -RUN chown -R test:test /home/test/.ssh +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh # # \"$@\" From c0ee5e29fad5650901999fe973fb02b277e275cd Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 19:21:14 +0300 Subject: [PATCH 63/66] CI: Dockerfile--alpine is optimized --- Dockerfile--alpine.tmpl | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index aa764cc..d8bbc73 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -3,32 +3,29 @@ ARG PYTHON_VERSION=3.12 # --------------------------------------------- base1 FROM python:${PYTHON_VERSION}-alpine AS base1 -RUN apk add --no-cache coreutils +RUN apk add --no-cache \ + coreutils \ + bash \ + mc \ + procps \ + openssh \ + sshpass \ + sudo \ + git # --------------------------------------------- base2 FROM base1 AS base2 -RUN apk add python3-dev build-base musl-dev linux-headers -RUN apk add git +RUN apk add --no-cache \ + python3-dev \ + build-base\ + musl-dev \ + linux-headers # --------------------------------------------- final FROM base2 AS final -RUN apk update -RUN apk add mc -RUN apk add bash - -# Full version of "ps" command -RUN apk add --no-cache procps - -RUN apk add --no-cache openssh -RUN apk add --no-cache sshpass -RUN apk add --no-cache sudo - -RUN adduser -D test - -RUN addgroup -S sudo -RUN adduser test sudo +RUN adduser -D test && addgroup -S sudo && adduser test sudo EXPOSE 22 RUN ssh-keygen -A @@ -40,11 +37,11 @@ WORKDIR /home/test/testgres RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers # THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD -RUN sh -c "echo "test:*" | chpasswd -e" +RUN echo "test:*" | chpasswd -e -RUN chmod 700 /home/test/ -RUN mkdir -p /home/test/.ssh -RUN chown -R test:test /home/test/.ssh +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh # # \"$@\" From 5eef0cc94e1ac2527d0414a8b21848f7cf1ca054 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 19:33:17 +0300 Subject: [PATCH 64/66] CI: Dockerfile--astralinux_1_7 is optimized --- Dockerfile--astralinux_1_7.tmpl | 46 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index 851c9b1..0992a3e 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -3,25 +3,27 @@ ARG PYTHON_VERSION=3 # --------------------------------------------- base1 FROM packpack/packpack:astra-1.7 AS base1 -RUN apt update -RUN apt install -y sudo curl ca-certificates -RUN apt update -RUN apt install -y openssh-server -RUN apt install -y sshpass -# RUN apt install -y time -# RUN apt install -y netcat-traditional - -# it installs "ip" utility -RUN apt install -y iproute2 - -RUN apt install -y git - -# RUN apt install -y mc -# RUN apt install -y nano +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + sudo \ + curl \ + ca-certificates \ + openssh-server \ + sshpass \ + iproute2 \ + git \ + && rm -rf /var/lib/apt/lists/* # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 -RUN apt install -y python3 python3-dev python3-venv + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 \ + python3-dev \ + python3-venv \ + && rm -rf /var/lib/apt/lists/* + ENV PYTHON_VERSION=3 # --------------------------------------------- final @@ -39,17 +41,17 @@ RUN useradd -m test RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers # THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD -RUN sh -c "echo "test:*" | chpasswd -e" -RUN sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config +RUN echo "test:*" | chpasswd -e && \ + sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config -ADD --chown=test:test . /home/test/testgres +COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -RUN chmod 700 /home/test/ -RUN mkdir -p /home/test/.ssh -RUN chown -R test:test /home/test/.ssh +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh # # \"$@\" From ab780c5454b3ab7f77de0c00aebb3394f930d975 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 19:57:09 +0300 Subject: [PATCH 65/66] CI: Dockerfile--altlinux_1x are optimized --- Dockerfile--altlinux_10.tmpl | 60 +++++++++++++++++----------------- Dockerfile--altlinux_11.tmpl | 63 ++++++++++++++++++------------------ 2 files changed, 62 insertions(+), 61 deletions(-) diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index 3f4908e..2e58975 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -3,52 +3,54 @@ ARG PYTHON_VERSION=3 # --------------------------------------------- base1 FROM alt:p10 AS base1 -RUN apt-get update -RUN apt-get install -y sudo curl ca-certificates -RUN apt-get update -RUN apt-get install -y openssh-server openssh-clients -RUN apt-get install -y sshpass -RUN apt-get install -y time -RUN apt-get install -y su - -# RUN apt-get install -y mc - -EXPOSE 22 -RUN ssh-keygen -A - -# --------------------------------------------- dev_tools -FROM base1 AS base1_with_dev_tools - -RUN apt-get update -RUN apt-get install -y git +RUN apt-get update && apt-get install -y \ + sudo \ + curl \ + ca-certificates \ + openssh-server \ + openssh-clients \ + sshpass \ + time \ + su \ + git \ + && apt-get clean # --------------------------------------------- base2_with_python-3 -FROM base1_with_dev_tools AS base2_with_python-3 -RUN apt-get install -y python3 -RUN apt-get install -y python3-dev +FROM base1 AS base2_with_python-3 + +RUN apt-get update && apt-get install -y \ + python3 \ + python3-dev \ + && apt-get clean ENV PYTHON_VERSION=3 # --------------------------------------------- final FROM base2_with_python-${PYTHON_VERSION} AS final +EXPOSE 22 +RUN ssh-keygen -A + RUN adduser test -G wheel # It enables execution of "sudo service ssh start" without password RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers -ADD --chown=test:test . /home/test/testgres +# +# Altlinux 10 and 11 too slowly create a new SSH connection (x6). +# +# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS) +# +RUN echo "UseDNS no" >> /etc/openssh/sshd_config + +COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -RUN chmod 700 /home/test/ -RUN mkdir -p /home/test/.ssh -RUN chown -R test:test /home/test/.ssh - -# -# Altlinux 10 and 11 too slowly create a new SSH connection (x6). -# +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh # # \"$@\" diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index 44edfe3..f63a277 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -3,55 +3,54 @@ ARG PYTHON_VERSION=3 # --------------------------------------------- base1 FROM alt:p11 AS base1 -RUN apt-get update -RUN apt-get install -y sudo curl ca-certificates -RUN apt-get update -RUN apt-get install -y openssh-server openssh-clients -RUN apt-get install -y sshpass -RUN apt-get install -y time -RUN apt-get install -y su - -# pgrep (for testgres.os_ops) -RUN apt-get install -y procps - -# RUN apt-get install -y mc - -EXPOSE 22 -RUN ssh-keygen -A - -# --------------------------------------------- dev_tools -FROM base1 AS base1_with_dev_tools - -RUN apt-get update -RUN apt-get install -y git +RUN apt-get update && apt-get install -y \ + sudo \ + curl \ + ca-certificates \ + openssh-server \ + openssh-clients \ + sshpass \ + time \ + su \ + git \ + && apt-get clean # --------------------------------------------- base2_with_python-3 -FROM base1_with_dev_tools AS base2_with_python-3 -RUN apt-get install -y python3 -RUN apt-get install -y python3-dev +FROM base1 AS base2_with_python-3 + +RUN apt-get update && apt-get install -y \ + python3 \ + python3-dev \ + && apt-get clean ENV PYTHON_VERSION=3 # --------------------------------------------- final FROM base2_with_python-${PYTHON_VERSION} AS final +EXPOSE 22 +RUN ssh-keygen -A + RUN adduser test -G wheel # It enables execution of "sudo service ssh start" without password RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers -ADD --chown=test:test . /home/test/testgres +# +# Altlinux 10 and 11 too slowly create a new SSH connection (x6). +# +# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS) +# +RUN echo "UseDNS no" >> /etc/openssh/sshd_config + +COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres ENV LANG=C.UTF-8 -RUN chmod 700 /home/test/ -RUN mkdir -p /home/test/.ssh -RUN chown -R test:test /home/test/.ssh - -# -# Altlinux 10 and 11 too slowly create a new SSH connection (x6). -# +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh # # \"$@\" From d264a26a4647bcf54b41bab94ec0279d08ac4187 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sun, 5 Jul 2026 20:13:52 +0300 Subject: [PATCH 66/66] CI: Dockerfile--altlinux_11 is fixed (procps) --- Dockerfile--altlinux_11.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index f63a277..b91bca7 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y \ time \ su \ git \ + procps \ && apt-get clean # --------------------------------------------- base2_with_python-3