From b95d18ba7efd75fef3c5ec4040f91e65c9480b8d Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Thu, 20 Jun 2024 20:15:11 +0200 Subject: [PATCH] add test --- .../Makefile | 64 +++++++++++++++++++ .../PURPOSE | 5 ++ .../main.fmf | 31 +++++++++ .../runtest.sh | 48 ++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/Makefile create mode 100644 Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/PURPOSE create mode 100644 Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/main.fmf create mode 100755 Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/runtest.sh diff --git a/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/Makefile b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/Makefile new file mode 100644 index 0000000..406436b --- /dev/null +++ b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp +# Description: Test for BZ#1805972 (Creating tmp files for systemd on behalf of pptp) +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Sklenar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1805972 (Creating tmp files for systemd on behalf of pptp)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: pptp" >> $(METADATA) + @echo "Requires: pptp" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1805972" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/PURPOSE b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/PURPOSE new file mode 100644 index 0000000..a56ae4a --- /dev/null +++ b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp +Description: Test for BZ#1805972 (Creating tmp files for systemd on behalf of pptp) +Author: Petr Sklenar +Bug summary: Creating tmp files for systemd on behalf of pptp references legacy directory /var/run/ instead of /run +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1805972 diff --git a/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/main.fmf b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/main.fmf new file mode 100644 index 0000000..9a0c582 --- /dev/null +++ b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/main.fmf @@ -0,0 +1,31 @@ +summary: Test for BZ#1805972 (Creating tmp files for systemd on behalf of pptp) +description: | + Bug summary: Creating tmp files for systemd on behalf of pptp references legacy directory /var/run/ instead of /run + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1805972 +contact: Petr Sklenar +component: pptp +test: ./runtest.sh +framework: beakerlib +recommend: + - pptp +duration: 15m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - TIPpass_infra + - Tier1 +tier: '1' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1805972 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1657269 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + - enabled: false + when: purpose == gating and distro ~< rhel-8.3 + continue: false +extra-nitrate: TC#0607281 +extra-summary: /CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp +extra-task: /CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp diff --git a/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/runtest.sh b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/runtest.sh new file mode 100755 index 0000000..c98cc27 --- /dev/null +++ b/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp/runtest.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/pptp/Regression/Creating-tmp-files-for-systemd-on-behalf-of-pptp +# Description: Test for BZ#1805972 (Creating tmp files for systemd on behalf of pptp) +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="pptp" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + #journalctl --rotate + #journalctl --vacuum-time=1s + rlPhaseEnd + + rlPhaseStartTest + rlRun "systemd-tmpfiles --create" + rlRun "systemd-tmpfiles --clean" + rlRun "systemd-tmpfiles --remove" + rlRun "journalctl | grep systemd-tmpfiles |egrep -i 'error|fail|warn|/var/run'" 1 + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd