Skip to content

Install a massive package just to get a small .inf file with useless … #9

Install a massive package just to get a small .inf file with useless …

Install a massive package just to get a small .inf file with useless … #9

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
TEST_PASSWORD: "asd"
TEST_LDAP_CONNECTION_STRING: "ldap://localhost:3389"
TEST_SUFFIX: "dc=example,dc=test"
TEST_ACI_LDIF: "aci_tmp.ldif"
jobs:
run-tests:
strategy:
matrix:
dirsrv: [ '2.4', 'latest' ]
services:
dirsrv:
image: "389ds/dirsrv:${{ matrix.dirsrv }}"
ports:
- 3389:3389
env:
DS_SUFFIX_NAME: ${{env.TEST_SUFFIX}}
SUFFIX_NAME: ${{env.TEST_SUFFIX}}
DS_DM_PASSWORD: ${{env.TEST_PASSWORD}}
options: >-
--health-cmd "dsctl localhost healthcheck --check backends:localhost:search" --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# 389-ds-base is required for defaults.inf, to avoid the error "defaults.inf not found in any well known location!" in dsconf
# python3-lib389 is required for dsconf, since we cannot run commands inside the service container and there's no other documented way to create the tree/DIT/backend/suffix/database
- name: Install package dependencies
run: |
sudo apt-get install -y 389-ds-server python3-lib389 libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
- name: Actually create the suffix
run: |
dsconf -D "cn=Directory Manager" -w "$TEST_PASSWORD" $TEST_LDAP_CONNECTION_STRING backend create --create-suffix --suffix="$TEST_SUFFIX" --be-name="userRoot"
- name: Install Python dependencies
working-directory: ./aci
run: |
pip install -r requirements.txt
- name: Generate ACIs
working-directory: ./aci
run: |
python make_acis.py -l -s $TEST_SUFFIX > aci_tmp.ldif
- name: Run test script
working-directory: ./aci
run: |
pytest test_acis.py