test(installer): add OpenSSH distro harness
Все проверки выполнены успешно
CI / test (push) Successful in 3m33s
Docker / Build and publish worker image (push) Successful in 18m37s

Этот коммит содержится в:
Gleb Tv
2026-08-12 22:00:14 +03:00
родитель cb23f123ae
Коммит 4651deb280
18 изменённых файлов: 2408 добавлений и 21 удалений

21
internal/installer/harness/testdata/fixtures/alpine/Dockerfile поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,21 @@
# Alpine OpenSSH fixture for the source-install harness.
#
# Base image is the reg.rsxx.ru mirror (alpine:3). openrc is installed
# explicitly so init-system detection has a stable marker; openssh is the
# minimal sshd. Password auth is disabled; the fixture authenticates with
# the shared test key.
FROM reg.rsxx.ru/library/alpine:3
RUN apk add --no-cache openssh openrc \
&& mkdir -p /run/sshd /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
COPY keys/rsmon_test_ed25519.pub /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/authorized_keys
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-e"]

19
internal/installer/harness/testdata/fixtures/arch/Dockerfile поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,19 @@
# Arch Linux OpenSSH fixture for the source-install harness.
#
# No reg.rsxx.ru mirror exists for Arch yet, so the default is the
# Docker Hub archlinux:latest image. Override with RSMON_TEST_IMAGE_ARCH.
FROM archlinux:latest
RUN pacman -Sy --noconfirm --needed openssh \
&& mkdir -p /run/sshd /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
COPY keys/rsmon_test_ed25519.pub /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/authorized_keys
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-e"]

20
internal/installer/harness/testdata/fixtures/ubuntu/Dockerfile поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,20 @@
# Ubuntu OpenSSH fixture for the source-install harness.
#
# No reg.rsxx.ru mirror exists for Ubuntu yet, so the default is the
# Docker Hub ubuntu:24.04 image. Override with RSMON_TEST_IMAGE_UBUNTU.
FROM ubuntu:24.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openssh-server \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /run/sshd /root/.ssh \
&& chmod 700 /root/.ssh \
&& sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
&& sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
COPY keys/rsmon_test_ed25519.pub /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/authorized_keys
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-e"]

8
internal/installer/harness/testdata/keys/rsmon_test_ed25519 поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,8 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACCz7h3HFwJrC+DIrE3W+9yI+hRAcCVesyEQmCicmPrqAwAAAKgIO12YCDtd
mAAAAAtzc2gtZWQyNTUxOQAAACCz7h3HFwJrC+DIrE3W+9yI+hRAcCVesyEQmCicmPrqAw
AAAEDqbSMcuhF56miNJOZKUOuA/9I6yVga06nirb7pns41lLPuHccXAmsL4MisTdb73Ij6
FEBwJV6zIRCYKJyY+uoDAAAAIHJzbW9uLXdvcmtlciBzb3VyY2UtaW5zdGFsbCB0ZXN0AQ
IDBAU=
-----END OPENSSH PRIVATE KEY-----

1
internal/installer/harness/testdata/keys/rsmon_test_ed25519.pub поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPuHccXAmsL4MisTdb73Ij6FEBwJV6zIRCYKJyY+uoD rsmon-worker source-install test