Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit76fa94c

Browse files
[CI] Run tests on AltLinux 10 and 11 (#219)
This patch adds an automated tests of testgres on AltLinux 10 and 11.We will execute only "local" tests because AltLinux has an unexpected problem with SSH connection - it is created too slowly.
1 parentf0bf7a8 commit76fa94c

File tree

3 files changed

+238
-0
lines changed

3 files changed

+238
-0
lines changed

‎.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ env:
2828
-TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=10
2929
-TEST_PLATFORM=std-all PYTHON_VERSION=3 PG_VERSION=17
3030
-TEST_PLATFORM=ubuntu_24_04 PYTHON_VERSION=3 PG_VERSION=17
31+
-TEST_PLATFORM=altlinux_10 PYTHON_VERSION=3 PG_VERSION=17
32+
-TEST_PLATFORM=altlinux_11 PYTHON_VERSION=3 PG_VERSION=17

‎Dockerfile--altlinux_10.tmpl

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
ARG PG_VERSION
2+
ARG PYTHON_VERSION
3+
4+
# --------------------------------------------- base1
5+
FROM alt:p10 as base1
6+
ARG PG_VERSION
7+
8+
RUN apt-get update
9+
RUN apt-get install -y sudo curl ca-certificates
10+
RUN apt-get update
11+
RUN apt-get install -y openssh-server openssh-clients
12+
RUN apt-get install -y time
13+
14+
# RUN apt-get install -y mc
15+
16+
RUN apt-get install -y libsqlite3-devel
17+
18+
EXPOSE 22
19+
20+
RUN ssh-keygen -A
21+
22+
# --------------------------------------------- postgres
23+
FROM base1 as base1_with_dev_tools
24+
25+
RUN apt-get update
26+
27+
RUN apt-get install -y git
28+
RUN apt-get install -y gcc
29+
RUN apt-get install -y make
30+
31+
RUN apt-get install -y meson
32+
RUN apt-get install -y flex
33+
RUN apt-get install -y bison
34+
35+
RUN apt-get install -y pkg-config
36+
RUN apt-get install -y libssl-devel
37+
RUN apt-get install -y libicu-devel
38+
RUN apt-get install -y libzstd-devel
39+
RUN apt-get install -y zlib-devel
40+
RUN apt-get install -y liblz4-devel
41+
RUN apt-get install -y libzstd-devel
42+
RUN apt-get install -y libxml2-devel
43+
44+
# --------------------------------------------- postgres
45+
FROM base1_with_dev_tools as base1_with_pg-17
46+
47+
RUN git clone https://github.com/postgres/postgres.git -b REL_17_STABLE /pg/postgres/source
48+
49+
WORKDIR /pg/postgres/source
50+
51+
RUN ./configure --prefix=/pg/postgres/install --with-zlib --with-openssl --without-readline --with-lz4 --with-zstd --with-libxml
52+
RUN make -j 4 install
53+
RUN make -j 4 -C contrib install
54+
55+
# SETUP PG_CONFIG
56+
# When pg_config symlink in /usr/local/bin it returns a real (right) result of --bindir
57+
RUN ln -s /pg/postgres/install/bin/pg_config -t /usr/local/bin
58+
59+
# SETUP PG CLIENT LIBRARY
60+
# libpq.so.5 is enough
61+
RUN ln -s /pg/postgres/install/lib/libpq.so.5.17 /usr/lib64/libpq.so.5
62+
63+
# --------------------------------------------- base2_with_python-3
64+
FROM base1_with_pg-${PG_VERSION} as base2_with_python-3
65+
RUN apt-get install -y python3
66+
RUN apt-get install -y python3-dev
67+
RUN apt-get install -y python3-module-virtualenv
68+
RUN apt-get install -y python3-modules-sqlite3
69+
70+
# AltLinux does not have "generic" virtualenv utility. Let's create it.
71+
RUN if [[ -f "/usr/bin/virtualenv" ]] ; then \
72+
echo AAA; \
73+
elif [[ -f "/usr/bin/virtualenv3" ]] ; then \
74+
ln -s /usr/bin/virtualenv3 /usr/bin/virtualenv; \
75+
else \
76+
echo "/usr/bin/virtualenv is not created!"; \
77+
exit 1; \
78+
fi
79+
80+
ENV PYTHON_VERSION=3
81+
82+
# --------------------------------------------- final
83+
FROM base2_with_python-${PYTHON_VERSION} as final
84+
85+
RUN adduser test -G wheel
86+
87+
# It enables execution of "sudo service ssh start" without password
88+
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
89+
90+
ADD . /pg/testgres
91+
WORKDIR /pg/testgres
92+
RUN chown -R test /pg/testgres
93+
94+
ENV LANG=C.UTF-8
95+
96+
USER test
97+
98+
RUN chmod 700 ~/
99+
RUN mkdir -p ~/.ssh
100+
101+
#
102+
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
103+
#
104+
# So, we exclude the "remote" tests until this problem has been resolved.
105+
#
106+
107+
ENTRYPOINT sh -c " \
108+
set -eux; \
109+
echo HELLO FROM ENTRYPOINT; \
110+
echo HOME DIR IS [`realpath ~/`]; \
111+
sudo /usr/sbin/sshd; \
112+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
113+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
114+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
115+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
116+
chmod 600 ~/.ssh/authorized_keys; \
117+
ls -la ~/.ssh/; \
118+
TEST_FILTER=\"TestgresTests or (TestTestgresCommon and (not remote_ops))\" bash ./run_tests.sh;"

‎Dockerfile--altlinux_11.tmpl

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
ARG PG_VERSION
2+
ARG PYTHON_VERSION
3+
4+
# --------------------------------------------- base1
5+
FROM alt:p11 as base1
6+
ARG PG_VERSION
7+
8+
RUN apt-get update
9+
RUN apt-get install -y sudo curl ca-certificates
10+
RUN apt-get update
11+
RUN apt-get install -y openssh-server openssh-clients
12+
RUN apt-get install -y time
13+
14+
# RUN apt-get install -y mc
15+
16+
RUN apt-get install -y libsqlite3-devel
17+
18+
EXPOSE 22
19+
20+
RUN ssh-keygen -A
21+
22+
# --------------------------------------------- postgres
23+
FROM base1 as base1_with_dev_tools
24+
25+
RUN apt-get update
26+
27+
RUN apt-get install -y git
28+
RUN apt-get install -y gcc
29+
RUN apt-get install -y make
30+
31+
RUN apt-get install -y meson
32+
RUN apt-get install -y flex
33+
RUN apt-get install -y bison
34+
35+
RUN apt-get install -y pkg-config
36+
RUN apt-get install -y libssl-devel
37+
RUN apt-get install -y libicu-devel
38+
RUN apt-get install -y libzstd-devel
39+
RUN apt-get install -y zlib-devel
40+
RUN apt-get install -y liblz4-devel
41+
RUN apt-get install -y libzstd-devel
42+
RUN apt-get install -y libxml2-devel
43+
44+
# --------------------------------------------- postgres
45+
FROM base1_with_dev_tools as base1_with_pg-17
46+
47+
RUN git clone https://github.com/postgres/postgres.git -b REL_17_STABLE /pg/postgres/source
48+
49+
WORKDIR /pg/postgres/source
50+
51+
RUN ./configure --prefix=/pg/postgres/install --with-zlib --with-openssl --without-readline --with-lz4 --with-zstd --with-libxml
52+
RUN make -j 4 install
53+
RUN make -j 4 -C contrib install
54+
55+
# SETUP PG_CONFIG
56+
# When pg_config symlink in /usr/local/bin it returns a real (right) result of --bindir
57+
RUN ln -s /pg/postgres/install/bin/pg_config -t /usr/local/bin
58+
59+
# SETUP PG CLIENT LIBRARY
60+
# libpq.so.5 is enough
61+
RUN ln -s /pg/postgres/install/lib/libpq.so.5.17 /usr/lib64/libpq.so.5
62+
63+
# --------------------------------------------- base2_with_python-3
64+
FROM base1_with_pg-${PG_VERSION} as base2_with_python-3
65+
RUN apt-get install -y python3
66+
RUN apt-get install -y python3-dev
67+
RUN apt-get install -y python3-module-virtualenv
68+
RUN apt-get install -y python3-modules-sqlite3
69+
70+
# AltLinux does not have "generic" virtualenv utility. Let's create it.
71+
RUN if [[ -f "/usr/bin/virtualenv" ]] ; then \
72+
echo AAA; \
73+
elif [[ -f "/usr/bin/virtualenv3" ]] ; then \
74+
ln -s /usr/bin/virtualenv3 /usr/bin/virtualenv; \
75+
else \
76+
echo "/usr/bin/virtualenv is not created!"; \
77+
exit 1; \
78+
fi
79+
80+
ENV PYTHON_VERSION=3
81+
82+
# --------------------------------------------- final
83+
FROM base2_with_python-${PYTHON_VERSION} as final
84+
85+
RUN adduser test -G wheel
86+
87+
# It enables execution of "sudo service ssh start" without password
88+
RUN sh -c "echo \"WHEEL_USERS ALL=(ALL:ALL) NOPASSWD: ALL\"" >> /etc/sudoers
89+
90+
ADD . /pg/testgres
91+
WORKDIR /pg/testgres
92+
RUN chown -R test /pg/testgres
93+
94+
ENV LANG=C.UTF-8
95+
96+
USER test
97+
98+
RUN chmod 700 ~/
99+
RUN mkdir -p ~/.ssh
100+
101+
#
102+
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
103+
#
104+
# So, we exclude the "remote" tests until this problem has been resolved.
105+
#
106+
107+
ENTRYPOINT sh -c " \
108+
set -eux; \
109+
echo HELLO FROM ENTRYPOINT; \
110+
echo HOME DIR IS [`realpath ~/`]; \
111+
sudo /usr/sbin/sshd; \
112+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
113+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
114+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
115+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
116+
chmod 600 ~/.ssh/authorized_keys; \
117+
ls -la ~/.ssh/; \
118+
TEST_FILTER=\"TestgresTests or (TestTestgresCommon and (not remote_ops))\" bash ./run_tests.sh;"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp