Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
2540529
CI: Usage of separated machine for RemoteOperations tests
dmitry-lipetsk Jul 3, 2026
468b539
CI: CMD is fixed (zero element is ignored!)
dmitry-lipetsk Jul 3, 2026
fcb3d0c
CI: Copy TEST_PARAM_REMOTE2_SSH_KEY to file with right attributes
dmitry-lipetsk Jul 3, 2026
439dc43
CI: More prints of '/home/test/.ssh/' content
dmitry-lipetsk Jul 3, 2026
66a2bb2
CI: Try to fix 'authorized_keys' on the second machine
dmitry-lipetsk Jul 3, 2026
a522d25
CI: no lint and no build-check (temporary)
dmitry-lipetsk Jul 3, 2026
d8bd222
CI: bad path to authorized_keys_ci
dmitry-lipetsk Jul 3, 2026
4d702aa
CI: fix "needs"
dmitry-lipetsk Jul 3, 2026
eb5deee
CI: More logs for remote2 machine
dmitry-lipetsk Jul 3, 2026
f04c1f2
CI: More logs for remote2 machine (2)
dmitry-lipetsk Jul 3, 2026
4b0e2e6
CI: A mistake in correction command is fixed
dmitry-lipetsk Jul 3, 2026
100d451
CI: A mistake in correction command is fixed (2)
dmitry-lipetsk Jul 3, 2026
90229fe
CI: A mistake in correction command is fixed (3)
dmitry-lipetsk Jul 3, 2026
fc20863
CI: Run the second machine with "-t" option
dmitry-lipetsk Jul 3, 2026
bf8134d
CI: Two stage for second machine: run_with_detach + ssh_file_correction
dmitry-lipetsk Jul 3, 2026
3e97ddc
CI: Normalization
dmitry-lipetsk Jul 3, 2026
113c768
CI: All the alpines are restored
dmitry-lipetsk Jul 3, 2026
b0f3fcb
CI: ubuntu 24.04 is restored
dmitry-lipetsk Jul 3, 2026
faaf8c3
CI: ubuntu 24.04 is updated (cleanup)
dmitry-lipetsk Jul 3, 2026
2ffa576
CI: astralinux 1.7 is restored
dmitry-lipetsk Jul 3, 2026
9801be1
CI: run_tests3.sh is updated (#!/bin/bash)
dmitry-lipetsk Jul 3, 2026
8b6bfaf
CI: alpine, astra_1_7 and ubuntu 24.04 is corrected
dmitry-lipetsk Jul 3, 2026
1cc3f5c
CI: altlinux 11 is restored
dmitry-lipetsk Jul 3, 2026
e35db04
CI: Put id_ed25519 into /home/test/testgres/id_ed25519_test
dmitry-lipetsk Jul 3, 2026
e33cf50
CI: altlinux 10 is restored
dmitry-lipetsk Jul 3, 2026
2678914
CI: lint and build-check are restored
dmitry-lipetsk Jul 3, 2026
7067c24
New test: test_prove_environment_isolation
dmitry-lipetsk Jul 3, 2026
23ac373
rename: TEST_PARAM_xxx -> TEST_CFG_xxx
dmitry-lipetsk Jul 3, 2026
775fc08
New test parameter TEST_CFG_REMOTE2_PORT is added
dmitry-lipetsk Jul 3, 2026
7343ce4
correction: TEST_CFG_xxx -> TEST_CFG__xxx (unification)
dmitry-lipetsk Jul 3, 2026
1faf3bd
CI: (fix) TEST_CFG__REMOTE2_PORT=22 (not TEST_CFG__REMOTE2_HOST)
dmitry-lipetsk Jul 3, 2026
40041c6
correction: TEST_CFG__REMOTE2_ --> TEST_CFG__REMOTE_
dmitry-lipetsk Jul 3, 2026
4f658d2
CI: ci.yml is updated (remote2 -> remote)
dmitry-lipetsk Jul 3, 2026
a3eab07
English
dmitry-lipetsk Jul 3, 2026
f962fec
OsOpsDescrs is updated
dmitry-lipetsk Jul 4, 2026
41a1d55
run_tests3.sh prints values of "TEST_CFG__xxx"
dmitry-lipetsk Jul 4, 2026
f58a6d6
run_tests3.sh prints ALL envs
dmitry-lipetsk Jul 4, 2026
55d4818
fix: altlinux ran all the tests on the one machine
dmitry-lipetsk Jul 4, 2026
ab2ea3d
test_prove_environment_isolation is updated
dmitry-lipetsk Jul 4, 2026
02f6762
fix: ubuntu and astralinux are installing iproute2 package to get a '…
dmitry-lipetsk Jul 4, 2026
6c8b40a
test_prove_environment_isolation is updated
dmitry-lipetsk Jul 4, 2026
f43efd5
Merge branch 'master' into D20260703_001--ci-creates-two-machines-to-…
dmitry-lipetsk Jul 4, 2026
04d5584
CI: A work with id_ed25519_test.pub is improved
dmitry-lipetsk Jul 5, 2026
aa8a894
CI: [fix] test:test
dmitry-lipetsk Jul 5, 2026
526282f
CI: (remote2) map xxx.pub (600) to /home/test/.ssh/authorized_keys
dmitry-lipetsk Jul 5, 2026
a62c1cb
CI: (remote2) setup authorized_keys via conveyor
dmitry-lipetsk Jul 5, 2026
721682e
CI: "INSIDE CONTAINER .SSH" is corrected
dmitry-lipetsk Jul 5, 2026
e3ce285
CI: comments are corrected (altlinux)
dmitry-lipetsk Jul 5, 2026
2a0b22a
CI: RUN_CFG__REMOTE_NAME -> RUN_CFG__MACHINE2_NAME
dmitry-lipetsk Jul 5, 2026
f86c766
Merge branch 'master' into D20260703_001--ci-creates-two-machines-to-…
dmitry-lipetsk Jul 5, 2026
682f750
CI: docker network is used
dmitry-lipetsk Jul 5, 2026
e9e8b4e
CI: step names are updated (machine1, machine2)
dmitry-lipetsk Jul 5, 2026
dcd51e2
CI: Cleanup Docker resources
dmitry-lipetsk Jul 5, 2026
1d54b83
CI: (machine2) we will use "docker container inspect" instead sleep 1.0
dmitry-lipetsk Jul 5, 2026
cd36790
CI: lint and build-check use pip-cache
dmitry-lipetsk Jul 5, 2026
33770de
CI: ssh-keygen is called in quiet mode (-q)
dmitry-lipetsk Jul 5, 2026
04d1cbc
CI: RUN_CFG__MACHINE1_NAME is added
dmitry-lipetsk Jul 5, 2026
bd891df
CI: Formatting
dmitry-lipetsk Jul 5, 2026
1da98f7
CI: Comment on "-" in "- sleep infinity"
dmitry-lipetsk Jul 5, 2026
26f778c
CI: RUN_CFG__MACHINE1_NAME is fixed
dmitry-lipetsk Jul 5, 2026
41cde6d
CI: ENTRYPOINT is fixed (DUMMY-DUMMY-DUMMY)
dmitry-lipetsk Jul 5, 2026
9b3c56f
CI: Dockerfile--ubuntu_24_04 is optimized
dmitry-lipetsk Jul 5, 2026
b282644
CI: Dockerfile--alpine uses COPY (not ADD)
dmitry-lipetsk Jul 5, 2026
9af44f6
CI: Dockerfile--ubuntu_24_04 is optimized (2)
dmitry-lipetsk Jul 5, 2026
c0ee5e2
CI: Dockerfile--alpine is optimized
dmitry-lipetsk Jul 5, 2026
5eef0cc
CI: Dockerfile--astralinux_1_7 is optimized
dmitry-lipetsk Jul 5, 2026
ab780c5
CI: Dockerfile--altlinux_1x are optimized
dmitry-lipetsk Jul 5, 2026
d264a26
CI: Dockerfile--altlinux_11 is fixed (procps)
dmitry-lipetsk Jul 5, 2026
f32fe5a
Merge branch 'master' into D20260703_001--ci-creates-two-machines-to-…
dmitry-lipetsk Jul 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 86 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ 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__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]"
cat $GITHUB_ENV
- name: Checkout
Expand All @@ -118,11 +122,91 @@ 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 -q -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 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 }} \
"${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \
sleep infinity

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
#
cat ${{ github.workspace }}/${{ env.RUN_CFG__SSH_KEY_NAME }}.pub | \
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 \
"

#
# Log status
#
docker exec -u root ${{ env.RUN_CFG__MACHINE2_NAME }} sh -c "
echo '--- INSIDE CONTAINER OS ---' && \
cat /etc/os-release && \
echo '--- INSIDE CONTAINER .SSH ---' && \
ls -la /home/test/.ssh/ \
"

- 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.
# 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 }}" \
-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
uses: actions/upload-artifact@v7
if: always() # IT IS IMPORTANT!
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
60 changes: 41 additions & 19 deletions Dockerfile--alpine.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,48 @@ 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

USER test
RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
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
#
# \"$@\"
# - 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"]

ENTRYPOINT sh -c " \
# Run tests by default (master machine role)
CMD ["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_CFG__REMOTE_HOST:-}\" ]; then \
su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \
fi; \
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 ./; \
su test -c \"bash ./run_tests3.sh\"; \
"]
54 changes: 42 additions & 12 deletions Dockerfile--altlinux_10.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,47 @@ RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
chown -R test:test /home/test/.ssh

USER test
#
# \"$@\"
# - 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"]

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 /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_CFG__REMOTE_HOST:-}\" ]; then \
su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \
fi; \
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 ./; \
# 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; \
# 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\"; \
"]
54 changes: 42 additions & 12 deletions Dockerfile--altlinux_11.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,47 @@ RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
chown -R test:test /home/test/.ssh

USER test
#
# \"$@\"
# - 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"]

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 /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_CFG__REMOTE_HOST:-}\" ]; then \
su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \
fi; \
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 ./; \
# 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; \
# 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\"; \
"]
60 changes: 42 additions & 18 deletions Dockerfile--astralinux_1_7.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,46 @@ WORKDIR /home/test/testgres

ENV LANG=C.UTF-8

USER test

RUN chmod 700 ~/
RUN mkdir -p ~/.ssh
RUN chmod 700 ~/.ssh

ENTRYPOINT sh -c " \
RUN chmod 700 /home/test/ && \
mkdir -p /home/test/.ssh && \
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", " \
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_CFG__REMOTE_HOST:-}\" ]; then \
su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \
fi; \
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 ./; \
su test -c \"bash ./run_tests3.sh\"; \
"]
Loading