Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Azure pipelines ipa-4-6 #25

Open
wants to merge 2 commits into
base: ipa-4-6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions ipatests/azure/Dockerfiles/Dockerfile.build.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM fedora:28
MAINTAINER [FreeIPA Developers freeipa-devel@lists.fedorahosted.org]
ENV container=docker LANG=en_US.utf8 LANGUAGE=en_US.utf8 LC_ALL=en_US.utf8

ADD dist /root
RUN echo 'deltarpm = false' >> /etc/dnf/dnf.conf \
&& dnf update -y dnf \
&& dnf install -y dnf-plugins-core sudo wget systemd firewalld nss-tools iptables \
&& sed -i 's/%_install_langs \(.*\)/\0:fr/g' /etc/rpm/macros.image-language-conf \
&& dnf install -y glibc-langpack-fr glibc-langpack-en \
&& dnf install -y /root/rpms/*.rpm \
&& dnf install -y openssh-server \
&& dnf clean all && rm -rf /root/rpms /root/srpms \
&& sed -i 's/.*PermitRootLogin .*/#&/g' /etc/ssh/sshd_config \
&& echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config \
&& systemctl enable sshd \
&& for i in /usr/lib/systemd/system/*-domainname.service; \
do sed -i 's#^ExecStart=/#ExecStart=-/#' $i ; done

STOPSIGNAL RTMIN+3
VOLUME ["/freeipa", "/run", "/tmp"]
ENTRYPOINT [ "/usr/sbin/init" ]
55 changes: 55 additions & 0 deletions ipatests/azure/Dockerfiles/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: '2.1'
services:
master:
image: ${IPA_DOCKER_IMAGE}
build: .
cap_add:
- ALL
security_opt:
- apparmor:unconfined
mem_limit: 1610612736
volumes:
- /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
- ./ipa-test-config.yaml:/root/.ipa/ipa-test-config.yaml:ro
- ${BUILD_REPOSITORY_LOCALPATH}:${IPA_TESTS_REPO_PATH}

networks:
- ${IPA_NETWORK}

replica:
image: ${IPA_DOCKER_IMAGE}
build: .
cap_add:
- ALL
security_opt:
- apparmor:unconfined
mem_limit: 1610612736
volumes:
- /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
networks:
- ${IPA_NETWORK}

client:
image: ${IPA_DOCKER_IMAGE}
build: .
cap_add:
- ALL
security_opt:
- apparmor:unconfined
mem_limit: 536870912
volumes:
- /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
# nfs server
- ./exports:/exports
- /lib/modules:/lib/modules:ro
networks:
- ${IPA_NETWORK}

networks:
ipanet:
driver: bridge
enable_ipv6: true
ipam:
driver: default
config:
- subnet: ${IPA_IPV6_SUBNET}
159 changes: 159 additions & 0 deletions ipatests/azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
trigger:
- master

variables:
- template: templates/variables-common.yml
# platform specific variables, links to
- template: templates/variables.yml

jobs:
- job: Build
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
git update-ref refs/heads/$(System.PullRequest.TargetBranch) origin/$(System.PullRequest.TargetBranch)
make V=0 "GIT_BRANCH=$(System.PullRequest.TargetBranch)" fastlint
displayName: Quick code style check
condition: eq(variables['Build.Reason'], 'PullRequest')
- template: templates/${{ variables.BUILD_TEMPLATE }}
- template: templates/publish-build.yml
parameters:
artifactName: 'packages-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Build.Repository.LocalPath)/dist
displayName: Publish packages

- script: |
set -e
mkdir container
cp -pr dist container/
cp $(IPA_TESTS_DOCKERFILES)/$(DOCKER_DOCKERFILE) container/Dockerfile
cd container
docker build -t freeipa-azure-builder .
docker save freeipa-azure-builder | gzip > '$(builddir)/freeipa-azure-builder-container.tar.gz'
displayName: Create container image for test
- template: templates/publish-build.yml
parameters:
artifactName: 'image-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Build.Repository.LocalPath)/freeipa-azure-builder-container.tar.gz
displayName: Publish container image
- template: templates/generate-matrix.yml
parameters:
definition: 'ipatests/azure/azure_definitions/gating.yml'
displayName: Generate Matrix for Gating tests
name: gating_matrix
- template: templates/generate-matrix.yml
parameters:
definition: 'ipatests/azure/azure_definitions/base.yml'
displayName: Generate Matrix for Base tests
name: base_matrix

- job: Lint
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
echo "Running make target 'lint'"
make V=0 lint
displayName: Lint sources

- job: Tox
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
architecture: x64
- template: templates/${{ variables.PREPARE_TOX_TEMPLATE }}
- script: |
set -e
echo "Running tox"
export LANG=en_US.utf8
export LC_CTYPE=en_US.utf8
locale
$(TOX_COMMAND) -e py37,pypi,pylint3
displayName: Tox
- task: PublishTestResults@2
inputs:
testResultsFiles: '.tox/**/junit-*.xml'
testRunTitle: 'Tox results'
condition: succeededOrFailed()

- job: WebUI_Unit_Tests
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
architecture: x64
- template: templates/${{ variables.PREPARE_WEBUI_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
echo "Running WebUI unit tests"
cd $(builddir)/install/ui/js/libs && make
cd $(builddir)/install/ui && npm install
cd $(builddir)/install/ui && node_modules/grunt/bin/grunt --verbose test
displayName: WebUI Unit Tests
- task: PublishTestResults@2
inputs:
testResultsFiles: 'install/ui/_build/test-reports/TEST-*.xml'
testRunTitle: 'Web UI unit test results'
condition: succeededOrFailed()

- job: BASE_XMLRPC
pool:
vmImage: $(VM_IMAGE)
dependsOn: Build
condition: succeeded()
strategy:
matrix: $[ dependencies.Build.outputs['base_matrix.matrix'] ]
steps:
- template: templates/generate-job-variables.yml
- template: templates/test-jobs.yml

- job: GATING
pool:
vmImage: $(VM_IMAGE)
dependsOn: Build
condition: succeeded()
strategy:
matrix: $[ dependencies.Build.outputs['gating_matrix.matrix'] ]
timeoutInMinutes: 90
steps:
- template: templates/generate-job-variables.yml
- template: templates/test-jobs.yml
23 changes: 23 additions & 0 deletions ipatests/azure/azure_definitions/base-fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
vms:
- vm_jobs:
- container_job: base
tests:
- test_cmdline
- test_install
- test_ipaclient
- test_ipalib
- test_ipaplatform
- test_ipapython
- test_ipaserver
- test_ipatests_plugins
- test_xmlrpc/test_dns_plugin.py
ignore:
- test_ipapython/test_keyring.py
type: base

- container_job: xmlrpc
tests:
- test_xmlrpc
ignore:
- test_xmlrpc/test_dns_plugin.py
type: base
1 change: 1 addition & 0 deletions ipatests/azure/azure_definitions/base.yml
111 changes: 111 additions & 0 deletions ipatests/azure/azure_definitions/gating-fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
vms:
- vm_jobs:
- container_job: InstallMaster
tests:
- test_integration/test_installation.py::TestInstallMaster

- container_job: kerberos_flags
containers:
clients: 1
tests:
- test_integration/test_kerberos_flags.py

- container_job: forced_client_reenrollment
containers:
replicas: 1
clients: 1
tests:
- test_integration/test_forced_client_reenrollment.py

- container_job: external_ca_ExternalCAInstall
tests:
- test_integration/test_external_ca.py::TestExternalCAInstall

- container_job: membermanager
tests:
- test_integration/test_membermanager.py

- vm_jobs:
- container_job: InstallDNSSECFirst
containers:
replicas: 1
tests:
- test_integration/test_dnssec.py::TestInstallDNSSECFirst

- container_job: simple_replication
containers:
replicas: 1
tests:
- test_integration/test_simple_replication.py

- container_job: service_permissions
tests:
- test_integration/test_service_permissions.py

- container_job: netgroup
tests:
- test_integration/test_netgroup.py

- container_job: external_ca_ExternalCAProfileScenarios
tests:
- test_integration/test_external_ca.py::TestExternalCAProfileScenarios

# requires external DNS configuration, this is not set up yet
# - container_job: authselect
# containers:
# clients: 1
# tests:
# - test_integration/test_authselect.py

- vm_jobs:
- container_job: sudo
containers:
clients: 1
tests:
- test_integration/test_sudo.py

- container_job: external_ca_ExternalCA
containers:
replicas: 1
clients: 1
tests:
- test_integration/test_external_ca.py::TestExternalCA

# requires nothing, installs nothing
- container_job: topologies_and_testconfig
tests:
- test_integration/test_topologies.py
- test_integration/test_testconfig.py

- container_job: external_ca_SelfExternalSelf
tests:
- test_integration/test_external_ca.py::TestSelfExternalSelf

- container_job: external_ca_ExternalCAConstraints
containers:
clients: 1
tests:
- test_integration/test_external_ca.py::TestExternalCAConstraints

- vm_jobs:
- container_job: commands
tests:
- test_integration/test_commands.py

- container_job: ServerReplicaCALessToCAFull
tests:
- test_integration/test_caless.py::TestServerReplicaCALessToCAFull
containers:
replicas: 1

- container_job: SubCAkeyReplication
containers:
replicas: 1
tests:
- test_integration/test_replica_promotion.py::TestSubCAkeyReplication

- container_job: advise
containers:
clients: 1
tests:
- test_integration/test_advise.py
1 change: 1 addition & 0 deletions ipatests/azure/azure_definitions/gating.yml
Loading