echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02speedup
echo 'man-db man-db/auto-update boolean false' | debconf-set-selections
+ #
+ # Required so that the checkout action uses git protocol rather than the GitHub REST API.
+ # make rpm requires the FR directory to be a git repository.
+ #
- name: Install recent git
run: |
apt-get update
mv libkqueue/*.deb debs
mv *.deb debs
+ - name: Build eapol_test
+ run: |
+ apt-get install -y libnl-3-dev libnl-genl-3-dev
+ ./configure
+ make -j `nproc` eapol_test
+ mv scripts/ci/eapol_test/eapol_test ../debs
+ working-directory: freeradius
+
- name: Store DEBs
uses: actions/upload-artifact@v2
with:
steps:
+ # For pkill
+ - name: Install procps
+ run: |
+ apt-get update
+ apt-get install -y --no-install-recommends procps
+
- name: Load DEBs
uses: actions/download-artifact@v2
with:
- name: Install DEBs
run: |
- apt-get update
find . -maxdepth 1 -name '*.deb' | xargs apt-get install -y --no-install-recommends
- - name: Startup test
+ - name: Config test
run: |
freeradius -XC
+ #
+ # We now perform some post-install tests that depend on the availability
+ # of the source tree
+ #
+ - name: Install pre-built eapol_test
+ run: |
+ apt-get install -y libssl1.? libdbus-1-? libnl-3-200 libnl-genl-3-200
+ mv eapol_test /usr/local/bin
+ chmod +x /usr/local/bin/eapol_test
+
+ - uses: actions/checkout@v2
+ with:
+ path: freeradius
+
+ - name: Run the post-install test target
+ run: |
+ make -C raddb/certs
+ touch Make.inc
+ mkdir -p build/tests/eapol_test
+ echo "EAPOL_TEST=" $(which eapol_test) > build/tests/eapol_test/eapol_test.mk
+ make -f scripts/ci/package-test.mk package-test
+ working-directory: freeradius
+
+ - name: Upload radius logs on failure
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: radius-logs-${{ matrix.env.NAME }}.tgz
+ path: |
+ /var/log/freeradius
+ freeradius/build/tests/eapol_test
- name: Build RPMs
run: |
[ -r /opt/rh/devtoolset-8/enable ] && source /opt/rh/devtoolset-8/enable || :
+ ./configure
make rpm
working-directory: freeradius
mv libkqueue/*.rpm rpms
mv freeradius/rpmbuild/RPMS/x86_64/*.rpm rpms
+ - name: Build eapol_test
+ run: |
+ yum install -y libnl3-devel which
+ [ -r /opt/rh/devtoolset-8/enable ] && source /opt/rh/devtoolset-8/enable || :
+ make -j `nproc` eapol_test
+ mv scripts/ci/eapol_test/eapol_test ../rpms
+ working-directory: freeradius
+
- name: Store RPMs
uses: actions/upload-artifact@v2
with:
yum config-manager --enable PowerTools || :
yum config-manager --enable powertools || :
+ # For pkill
+ - name: Enable procps-ng on Fedora
+ if: ${{ startsWith(matrix.env.NAME, 'fedora-') }}
+ run: |
+ yum install -y procps-ng
+
- name: Load RPMs
uses: actions/download-artifact@v2
with:
run: |
radiusd -XC
+ #
+ # We now perform some post-install tests that depend on the availability
+ # of the source tree
+ #
+ - name: Install pre-built eapol_test
+ run: |
+ yum install -y libnl3 make gdb which
+ mv eapol_test /usr/local/bin
+ chmod +x /usr/local/bin/eapol_test
+
+ - uses: actions/checkout@v2
+ with:
+ path: freeradius
+
+ - name: Run the post-install test target
+ run: |
+ make -C raddb/certs
+ touch Make.inc
+ mkdir -p build/tests/eapol_test
+ echo "EAPOL_TEST=" $(which eapol_test) > build/tests/eapol_test/eapol_test.mk
+ make -f scripts/ci/package-test.mk package-test
+ working-directory: freeradius
+
+ - name: Upload radius logs on failure
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: radius-logs-${{ matrix.env.NAME }}.tgz
+ path: |
+ /var/log/radius
+ freeradius/build/tests/eapol_test
--- /dev/null
+#
+# This Makefile performs some end to end tests against a package installed
+# within the CI environment.
+#
+# It reuses the eapol_test build-time tests, but runs them against the assets
+# installed by the distribution packaging.
+#
+# We want the run-time environment to be lean, typical of a fresh system
+# installation so that we catch any missing runtime dependancies, assets
+# missing from the packages, issues with the dynamic loader, etc.
+#
+# Therefore we skip the usual build framework so that we do not have so
+# configure the build tree and so that our only dependency is some non-ancient
+# version GNU Make. (Any version in a supported distribution will do.)
+#
+
+ifeq "${VERBOSE}" ""
+ Q=@
+else
+ Q=
+endif
+
+
+# Provide what test.eap needs
+top_srcdir:=.
+BUILD_DIR:=build
+DIR:=src/tests/eapol_test
+OUTPUT:=$(BUILD_DIR)/tests/eapol_test
+
+ALL_TGTS:=$(addprefix rlm_eap_,$(notdir $(subst -,_,$(patsubst %.conf,%.la,$(wildcard $(DIR)/*.conf)))))
+
+#
+# For the package tests we use the system version of radiusd on the standard
+# port
+#
+RADIUSD_BIN:=$(shell which radiusd || which freeradius)
+PORT:=1812
+SECRET:=testing123
+
+#
+# We assume a preinstalled version of eapol_test
+#
+EAPOL_TEST:=$(shell which eapol_test)
+
+# This Makefile, for meta-making
+POST_INSTALL_MAKEFILE_ARG:=-f $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+
+POST_INSTALL_RADIUSD_BIN_ARG:=RADIUSD_BIN=$(RADIUSD_BIN)
+
+.PHONY: package-test
+package-test: test.eap
+
+include $(DIR)/all.mk
#
$(OUTPUT)/%.ok: $(DIR)/%.conf | $(GENERATED_CERT_FILES)
@echo "EAPOL-TEST $(notdir $(patsubst %.conf,%,$<))"
- ${Q}$(MAKE) --no-print-directory test.eap.radiusd_kill
- ${Q}$(MAKE) --no-print-directory METHOD=$(basename $(notdir $@)) test.eap.radiusd_start
+ ${Q}$(MAKE) $(POST_INSTALL_MAKEFILE_ARG) --no-print-directory test.eap.radiusd_kill
+ ${Q}$(MAKE) $(POST_INSTALL_MAKEFILE_ARG) --no-print-directory METHOD=$(basename $(notdir $@)) test.eap.radiusd_start $(POST_INSTALL_RADIUSD_BIN_ARG)
${Q} [ -f $(dir $@)/radiusd.pid ] || exit 1
$(eval OUT := $(patsubst %.ok,%.log,$@))
$(eval KEY := $(shell grep key_mgmt=NONE $< | sed 's/key_mgmt=NONE/-n/'))
echo "Last entries in server log ($(RADIUS_LOG)):"; \
echo "--------------------------------------------------"; \
echo "$(EAPOL_TEST) -c \"$<\" -p $(PORT) -s $(SECRET)"; \
- $(MAKE) test.eap.radiusd_kill; \
+ $(MAKE) $(POST_INSTALL_MAKEFILE_ARG) test.eap.radiusd_kill; \
echo "RADIUSD : OUTPUT=$(dir $@) TESTDIR=$(dir $<) METHOD=$(notdir $(patsubst %.conf,%,$<)) TEST_PORT=$(PORT) $(RADIUSD_BIN) -Pxxx -n servers -d $(dir $<)config -D share/dictionary/ -lstdout -f";\
echo "EAPOL : $(EAPOL_TEST) -c \"$<\" -p $(PORT) -s $(SECRET) $(KEY) "; \
echo " log is in $(OUT)"; \
rm -f $(BUILD_DIR)/tests/test.eap; \
- $(MAKE) --no-print-directory test.eap.radiusd_kill; \
+ $(MAKE) $(POST_INSTALL_MAKEFILE_ARG) --no-print-directory test.eap.radiusd_kill; \
exit 1;\
fi
- ${Q}$(MAKE) --no-print-directory test.eap.radiusd_stop
+ ${Q}$(MAKE) $(POST_INSTALL_MAKEFILE_ARG) --no-print-directory test.eap.radiusd_stop
${Q}touch $@
$(TEST): $(EAPOL_OK_FILES)