From bbe7d36bea7b148423fd1882a707e28e9f54dd64 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Tue, 11 Jul 2023 12:31:39 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 8 +++++- tests/first-test/Makefile | 46 ++++++++++++++++++++++++++++++++++ tests/first-test/PURPOSE | 2 ++ tests/first-test/gss.conf | 7 ++++++ tests/first-test/httpd.service | 3 +++ tests/first-test/ntlmfile | 1 + tests/first-test/runtest.sh | 39 ++++++++++++++++++++++++++++ tests/tests.yml | 12 +++++++++ 8 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 tests/first-test/Makefile create mode 100644 tests/first-test/PURPOSE create mode 100644 tests/first-test/gss.conf create mode 100644 tests/first-test/httpd.service create mode 100644 tests/first-test/ntlmfile create mode 100755 tests/first-test/runtest.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index 20c3ec3..23cdfea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ -SOURCES/gssntlmssp-0.7.0.tar.gz +/gssntlmssp-0.1.0.tar.gz +/gssntlmssp-0.2.0.tar.gz +/gssntlmssp-0.3.0.tar.gz +/gssntlmssp-0.3.1.tar.gz +/gssntlmssp-0.4.0.tar.gz +/gssntlmssp-0.5.0.tar.gz +/gssntlmssp-0.6.0.tar.gz /gssntlmssp-0.7.0.tar.gz /gssntlmssp-1.2.0.tar.gz diff --git a/tests/first-test/Makefile b/tests/first-test/Makefile new file mode 100644 index 0000000..7369d91 --- /dev/null +++ b/tests/first-test/Makefile @@ -0,0 +1,46 @@ +# +# Author: Simo Sorce + +TOPLEVEL_NAMESPACE=/CoreOS +PACKAGE_NAME=gssntlmssp +RELATIVE_PATH=first-test + +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) +export TESTVERSION=1.0 + +.PHONY: all install download clean + +BUILT_FILES= +FILES=$(METADATA) runtest.sh Makefile gss.conf ntlmfile httpd.service + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ *.rpm $(BUILT_FILES) + + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo $(PACKAGE_NAME) + @echo "Owner: Simo Sorce " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPL" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Test gssntlmssp though mod_auth_gssapi and apache" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "Type: Install" >> $(METADATA) + @echo "Requires: curl" >> $(METADATA) + @echo "Requires: httpd" >> $(METADATA) + @echo "Requires: mod_auth_gssapi" >> $(METADATA) + @echo "Requires: gssntlmssp" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/first-test/PURPOSE b/tests/first-test/PURPOSE new file mode 100644 index 0000000..d6d855d --- /dev/null +++ b/tests/first-test/PURPOSE @@ -0,0 +1,2 @@ +This test sets up and verifies gssntlmssp via HTTPD and mod_auth_gssapi + diff --git a/tests/first-test/gss.conf b/tests/first-test/gss.conf new file mode 100644 index 0000000..b0d511d --- /dev/null +++ b/tests/first-test/gss.conf @@ -0,0 +1,7 @@ + + AuthType GSSAPI + AuthName "NTLMSSP" + GssapiAllowedMech ntlmssp + GssapiConnectionBound on + require valid-user + diff --git a/tests/first-test/httpd.service b/tests/first-test/httpd.service new file mode 100644 index 0000000..2c4cad4 --- /dev/null +++ b/tests/first-test/httpd.service @@ -0,0 +1,3 @@ +.include /lib/systemd/system/httpd.service +[Service] +Environment=NTLM_USER_FILE=/etc/httpd/ntlmfile diff --git a/tests/first-test/ntlmfile b/tests/first-test/ntlmfile new file mode 100644 index 0000000..5292a3d --- /dev/null +++ b/tests/first-test/ntlmfile @@ -0,0 +1 @@ +TESTDOM:testuser:testpassword diff --git a/tests/first-test/runtest.sh b/tests/first-test/runtest.sh new file mode 100755 index 0000000..9a09d20 --- /dev/null +++ b/tests/first-test/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Author: Simo Sorce + +. /usr/bin/rhts-environment.sh +echo "rhts-environment sourced, status = $?" + +. /usr/share/beakerlib/beakerlib.sh +echo "beakerlib sourced, status = $?" + +rlJournalStart + + rlPhaseStartSetup "Check than we have Apache" + export PACKAGES="httpd mod_auth_gssapi gssntlmssp" + rlAssertRpm --all + rlPhaseEnd + + rlPhaseStartSetup "Setup httpd to use mod_auth_gssapi" + rlRun "mkdir -p /var/www/html" + rlRun "echo OK > /var/www/html/private" + rlRun "cp gss.conf /etc/httpd/conf.d/gss.conf" + rlRun "cp ntlmfile /etc/httpd/ntlmfile" + rlRun "cp -f httpd.service /etc/systemd/system/httpd.service" + rlRun "systemctl daemon-reload" + rlRun "systemctl restart httpd" + rlPhaseEnd + + rlPhaseStartTest "Run HTTP requests against the setup" + export NTLM_USER_FILE=/etc/httpd/ntlmfile + rlRun "curl -si http://$( hostname )/private > /tmp/curl.out.$$" + rlAssertNotGrep "200 OK" /tmp/curl.out.$$ + rlRun "curl --negotiate -u : -si http://$( hostname )/private > /tmp/curl.out.$$" + rlAssertGrep "200 OK" /tmp/curl.out.$$ + rlAssertGrep "^OK$" /tmp/curl.out.$$ + rlPhaseEnd + +rlJournalEnd +rlJournalPrintText + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b4b2c48 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - first-test + required_packages: + - curl + - httpd + - mod_auth_gssapi +