From c2aea05d1d4e786744fce33ffcba1bfbf1b24e46 Mon Sep 17 00:00:00 2001 From: Jan Scotka Date: Thu, 12 Oct 2017 13:54:27 +0200 Subject: [PATCH] initial testing for directory server via nspawn in MTF --- README.md | 11 ++++++++++- tests/Makefile | 6 ++++++ tests/config.yaml | 22 ++++++++++++++++++++++ tests/ds-config.ini | 10 ++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/Makefile create mode 100644 tests/config.yaml create mode 100644 tests/ds-config.ini diff --git a/README.md b/README.md index 2a4d447..b2d8d29 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # 389-ds -The 389-ds package \ No newline at end of file +The 389-ds package + +## how to test module + +* Install meta-test-family: http://meta-test-family.readthedocs.io/en/latest/installation.html +* Find/Create compose and use it as input `URL` envvar +``` +COMPOSE=http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/26/Everything/x86_64/os/ +sudo MODULE=nspawn URL=$COMPOSE make -C tests/ test +``` \ No newline at end of file diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..6683583 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,6 @@ +# Installation +# https://meta-test-family.readthedocs.io/en/latest/installation.html#installing-mtf +test: + mtf-env-set + mtf-generator + mtf -l *.py diff --git a/tests/config.yaml b/tests/config.yaml new file mode 100644 index 0000000..35aba08 --- /dev/null +++ b/tests/config.yaml @@ -0,0 +1,22 @@ +document: modularity-testing +version: 1 +name: 389-ds +modulemd-url: https://src.fedoraproject.org/cgit/modules/389-ds.git/plain/389-ds.yaml +packages: + profiles: + - default + rpms: + - openldap-clients +module: + rpm: + setup: cp ds-config.ini {ROOT}/opt/conf.ini + start: setup-ds.pl --silent --file=/opt/conf.ini; + systemctl start dirsrv@myexample + status: systemctl status dirsrv@myexample + stop: systemctl stop dirsrv@myexample + url: http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/26/Everything/x86_64/os/ +test: + simplequery: + - ldapsearch -h localhost -p 32222 -x -w password -s base -b '' 'objectclass=*' | grep 'dc=myexample' + simplequery_negative: + - ldapsearch -h localhost -p 32222 -x -w password -s base -b '' 'objectclass=aaa' | grep -v 'dc=myexample' \ No newline at end of file diff --git a/tests/ds-config.ini b/tests/ds-config.ini new file mode 100644 index 0000000..2c3c018 --- /dev/null +++ b/tests/ds-config.ini @@ -0,0 +1,10 @@ +[General] +FullMachineName=myexample.com +SuiteSpotUserID=nobody +#ServerRoot= /usr/lib/fedora-ds +[slapd] +ServerPort=32222 +ServerIdentifier=myexample +Suffix=dc=myexample,dc=com +RootDN=cn=Directory Manager +RootDNPwd=password