From 4e72bf76ad3907ca13b622bd20246d4bf5d6ac8d Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Tue, 22 Oct 2024 11:44:12 +0200 Subject: [PATCH] adjust tiers --- .../bz1364524-get-nonexistent-file/main.fmf | 4 +- Sanity/tls12/fetch | 7 ++ Sanity/tls12/main.fmf | 44 +++++++++ Sanity/tls12/proftpd.conf | 20 +++++ Sanity/tls12/runtest.sh | 89 +++++++++++++++++++ plans/ci.fmf | 6 ++ 6 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 Sanity/tls12/fetch create mode 100644 Sanity/tls12/main.fmf create mode 100644 Sanity/tls12/proftpd.conf create mode 100755 Sanity/tls12/runtest.sh create mode 100644 plans/ci.fmf diff --git a/Regression/bz1364524-get-nonexistent-file/main.fmf b/Regression/bz1364524-get-nonexistent-file/main.fmf index 60afbff..05e342c 100644 --- a/Regression/bz1364524-get-nonexistent-file/main.fmf +++ b/Regression/bz1364524-get-nonexistent-file/main.fmf @@ -20,9 +20,9 @@ tag: - TIPfail_systemd - TIPpass - TIPpass_Apps - - Tier1 + - Tier2 - noexpectedness -tier: '1' +tier: '2' link: - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1364524 adjust: diff --git a/Sanity/tls12/fetch b/Sanity/tls12/fetch new file mode 100644 index 0000000..6e7d875 --- /dev/null +++ b/Sanity/tls12/fetch @@ -0,0 +1,7 @@ +open localhost +set ssl:priority "NORMAL:+VERS-TLS1.2" +set net:max-retries 1 +login anonymous ftp@example.com +ls +get duck +bye diff --git a/Sanity/tls12/main.fmf b/Sanity/tls12/main.fmf new file mode 100644 index 0000000..7ea92c7 --- /dev/null +++ b/Sanity/tls12/main.fmf @@ -0,0 +1,44 @@ +summary: Test TLS 12 support +description: | + Test TLS 12 support +contact: Ondrej Mejzlik +component: + - lftp +test: ./runtest.sh +framework: beakerlib +require: + - library(openssl/certgen) + - library(distribution/epel) +recommend: + - lftp + - proftpd +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL7 + - TIPfail_infra + - TIPfail_samba + - TIPfail_systemd + - TIPpass + - TIPpass_Apps + - rhel-buildroot + - epel + - Tier1 +tier: 1 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1363629 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2124943 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1743571 +adjust: + - enabled: false + when: distro == rhel-4, rhel-5, rhel-7, rhel-alt-7 + continue: false + - enabled: false + when: arch !=i386 and arch != ppc64 and arch != x86_64 + continue: false +extra-nitrate: TC#0544315 +extra-summary: /CoreOS/lftp/Sanity/tls12 +extra-task: /CoreOS/lftp/Sanity/tls12 +id: c88a22b5-1efa-4377-b073-63940f64f0ad diff --git a/Sanity/tls12/proftpd.conf b/Sanity/tls12/proftpd.conf new file mode 100644 index 0000000..e7e5b52 --- /dev/null +++ b/Sanity/tls12/proftpd.conf @@ -0,0 +1,20 @@ + + TLSEngine on + TLSRequired on + TLSRSACertificateFile /etc/pki/tls/certs/localhost.crt + TLSRSACertificateKeyFile /etc/pki/tls/private/localhost.key + TLSCipherSuite ALL:!ADH:!DES + TLSOptions AllowClientRenegotiations NoSessionReuseRequired + TLSVerifyClient off + TLSProtocol TLSv1.2 + TLSLog /var/log/proftpd/tls.log + + + + + User ftp + Group ftp + UserAlias anonymous ftp + RequireValidShell off + + diff --git a/Sanity/tls12/runtest.sh b/Sanity/tls12/runtest.sh new file mode 100755 index 0000000..a2fe72c --- /dev/null +++ b/Sanity/tls12/runtest.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/lftp/Sanity/tls12 +# Description: Test TLS 1.2 support +# Author: Martin Frodl +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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 + +PACKAGES="lftp" + +rlJournalStart + rlPhaseStartSetup + rlRun "rlImport --all" + if rlIsRHEL; then + rlRun "yum -y install proftpd --enablerepo \*" 0 "Install proftpd" + fi + rlAssertRpm 'proftpd' || rlDie "Package proftpd not installed" + rlAssertRpm $PACKAGES || rlDie "Package $PACKAGES not installed" + + CONF="/etc/proftpd.conf" + rlFileBackup ${CONF} + rlRun "cp proftpd.conf ${CONF}" 0 "Configuring FTP server" + + SYSCONF="/etc/sysconfig/proftpd" + rlFileBackup ${SYSCONF} + rlRun "echo 'PROFTPD_OPTIONS=\"-DANONYMOUS_FTP -DTLS\"' > ${SYSCONF}" 0 "Enabling anonymous access over TLS" + + rlRun "rlFileBackup --clean /var/ftp" 0 "Backing up FTP server contents" + rlRun "echo 'Quack!' > /var/ftp/duck" 0 "Creating a test file on FTP server" + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp fetch ${TmpDir}" 0 "Copying lftp script to tmp directory" + rlRun "pushd ${TmpDir}" + + rlRun "x509KeyGen server" 0 "Generating server key pair" + rlRun "x509KeyGen ca" 0 "Generating CA certificate" + rlRun "x509SelfSign ca" 0 "Self-signing CA certificate" + rlRun "x509CertSign --CA ca server" 0 "Signing server certificate" + + rlFileBackup --clean /etc/pki + rlRun "cat $(x509Cert ca) >> /etc/pki/tls/certs/ca-bundle.crt" + rlRun "cp $(x509Cert server) /etc/pki/tls/certs/localhost.crt" + rlRun "cp $(x509Key server) /etc/pki/tls/private/localhost.key" + + rlRun "rlServiceStart proftpd" 0 "Starting FTP server" + rlPhaseEnd + + rlPhaseStartTest + rlRun -s "curl -v --ssl ftp://localhost/duck" 0 "Checking that FTP server is up and working properly" + rlAssertGrep 'Quack!' ${rlRun_LOG} + + rlRun -s "lftp -d -f ./fetch" 0 "Downloading test file with lftp" + rlAssertNotGrep 'A TLS packet with unexpected length was received' ${rlRun_LOG} + rlAssertExists "duck" + rlAssertGrep 'Quack!' "duck" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rlServiceStop proftpd" 0 "Stopping FTP server" + rlRun "x509RmAlias server" + rlRun "x509RmAlias ca" + rlRun "popd" + rlRun "rm -r ${TmpDir}" 0 "Removing tmp directory" + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..239d93d --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI plan, picks up all tests, runs in beakerlib. +discover: + - name: fedora + how: fmf +execute: + how: tmt