Skip to content

Commit 9f915d7

Browse files
[CI] AltLinux 10/11 are tested
1 parent d7a9545 commit 9f915d7

File tree

4 files changed

+148
-4
lines changed

4 files changed

+148
-4
lines changed

.github/workflows/package-verification.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
python: "3.13"
5656
- platform: "alpine"
5757
python: "3.14"
58+
- platform: "altlinux_10"
59+
python: "3"
60+
- platform: "altlinux_11"
61+
python: "3"
5862

5963
steps:
6064
- name: Prepare variables

Dockerfile--altlinux_10.tmpl

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
ARG PYTHON_VERSION
2+
3+
# --------------------------------------------- base1
4+
FROM alt:p10 as base1
5+
6+
RUN apt-get update
7+
RUN apt-get install -y sudo curl ca-certificates
8+
RUN apt-get update
9+
RUN apt-get install -y openssh-server openssh-clients
10+
RUN apt-get install -y time
11+
12+
# RUN apt-get install -y mc
13+
14+
RUN apt-get install -y libsqlite3-devel
15+
16+
EXPOSE 22
17+
18+
RUN ssh-keygen -A
19+
20+
# --------------------------------------------- dev_tools
21+
FROM base1 as base1_with_dev_tools
22+
23+
RUN apt-get update
24+
RUN apt-get install -y git
25+
26+
# --------------------------------------------- base2_with_python-3
27+
FROM base1_with_dev_tools as base2_with_python-3
28+
RUN apt-get install -y python3
29+
RUN apt-get install -y python3-dev
30+
# RUN apt-get install -y python3-module-virtualenv
31+
RUN apt-get install -y python3-modules-sqlite3
32+
33+
ENV PYTHON_VERSION=3
34+
35+
# --------------------------------------------- final
36+
FROM base2_with_python-${PYTHON_VERSION} as final
37+
38+
RUN adduser test -G wheel
39+
40+
# It enables execution of "sudo service ssh start" without password
41+
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
42+
43+
ADD . /home/test/testgres
44+
RUN chown -R test /home/test/testgres
45+
WORKDIR /home/test/testgres
46+
47+
ENV LANG=C.UTF-8
48+
49+
USER test
50+
51+
RUN chmod 700 ~/
52+
RUN mkdir -p ~/.ssh
53+
54+
#
55+
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
56+
#
57+
58+
ENTRYPOINT sh -c " \
59+
set -eux; \
60+
echo HELLO FROM ENTRYPOINT; \
61+
echo HOME DIR IS [`realpath ~/`]; \
62+
sudo /usr/sbin/sshd; \
63+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
64+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
65+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
66+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
67+
chmod 600 ~/.ssh/authorized_keys; \
68+
ls -la ~/.ssh/; \
69+
TEST_FILTER=\"\" bash ./run_tests3.sh;"

Dockerfile--altlinux_11.tmpl

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
ARG PYTHON_VERSION
2+
3+
# --------------------------------------------- base1
4+
FROM alt:p11 as base1
5+
6+
RUN apt-get update
7+
RUN apt-get install -y sudo curl ca-certificates
8+
RUN apt-get update
9+
RUN apt-get install -y openssh-server openssh-clients
10+
RUN apt-get install -y time
11+
12+
# pgrep (for testgres.os_ops)
13+
RUN apt-get install -y procps
14+
15+
# RUN apt-get install -y mc
16+
17+
RUN apt-get install -y libsqlite3-devel
18+
19+
EXPOSE 22
20+
21+
RUN ssh-keygen -A
22+
23+
# --------------------------------------------- dev_tools
24+
FROM base1 as base1_with_dev_tools
25+
26+
RUN apt-get update
27+
RUN apt-get install -y git
28+
29+
# --------------------------------------------- base2_with_python-3
30+
FROM base1_with_dev_tools as base2_with_python-3
31+
RUN apt-get install -y python3
32+
RUN apt-get install -y python3-dev
33+
# RUN apt-get install -y python3-module-virtualenv
34+
RUN apt-get install -y python3-modules-sqlite3
35+
36+
ENV PYTHON_VERSION=3
37+
38+
# --------------------------------------------- final
39+
FROM base2_with_python-${PYTHON_VERSION} as final
40+
41+
RUN adduser test -G wheel
42+
43+
# It enables execution of "sudo service ssh start" without password
44+
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
45+
46+
ADD . /home/test/testgres
47+
RUN chown -R test /home/test/testgres
48+
WORKDIR /home/test/testgres
49+
50+
ENV LANG=C.UTF-8
51+
52+
USER test
53+
54+
RUN chmod 700 ~/
55+
RUN mkdir -p ~/.ssh
56+
57+
#
58+
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
59+
#
60+
61+
ENTRYPOINT sh -c " \
62+
set -eux; \
63+
echo HELLO FROM ENTRYPOINT; \
64+
echo HOME DIR IS [`realpath ~/`]; \
65+
sudo /usr/sbin/sshd; \
66+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
67+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
68+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
69+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
70+
chmod 600 ~/.ssh/authorized_keys; \
71+
ls -la ~/.ssh/; \
72+
TEST_FILTER=\"\" bash ./run_tests3.sh;"

run_tests3.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ set -eux
55
# prepare python environment
66
VENV_PATH="/tmp/testgres_venv"
77
rm -rf $VENV_PATH
8-
python -m venv "${VENV_PATH}"
8+
python3 -m venv "${VENV_PATH}"
99
export VIRTUAL_ENV_DISABLE_PROMPT=1
1010
source "${VENV_PATH}/bin/activate"
11-
pip install -r tests/requirements.txt
11+
python3 -m pip install -r tests/requirements.txt
1212

1313
# check code style
1414
flake8 .
1515

1616
# run builtin tests
17-
python -m pytest -l -vvv -n 4
17+
python3 -m pytest -l -vvv -n 4
1818

1919
set +eux
20-

0 commit comments

Comments
 (0)