From 84319ada68efd5a5f1e28eac046f3f1b65d84095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Mon, 19 Oct 2020 16:04:55 +0200 Subject: [PATCH] Add plans for all supported shells, reorganize Create plan for each supported shell, pick relevant tests. Remove Makefile and PURPOSE files, they are no more necessary. Group tests and plans, each under a dedicated directory. Add tags to allow selecting tests for running in a container. --- func/Makefile | 64 ------------------ func/PURPOSE | 1 - login/Makefile | 66 ------------------- login/PURPOSE | 3 - login/main.fmf | 5 -- plans/bash.fmf | 7 ++ plans/dash.fmf | 7 ++ plans/ksh.fmf | 7 ++ plans/main.fmf | 6 ++ plans/mksh.fmf | 7 ++ plans/zsh.fmf | 7 ++ smoke/Makefile | 62 ----------------- smoke/PURPOSE | 8 --- {func => tests/functions}/main.fmf | 2 +- func/runtest.sh => tests/functions/test.sh | 0 tests/login/main.fmf | 12 ++++ {login => tests/login}/script.exp | 0 {login => tests/login}/ssh.exp | 0 login/runtest.sh => tests/login/test.sh | 0 {login => tests/login}/tst.sh | 0 main.fmf => tests/main.fmf | 5 +- {smoke => tests/smoke}/main.fmf | 0 {smoke => tests/smoke}/t_alias | 0 {smoke => tests/smoke}/t_conditionals | 0 {smoke => tests/smoke}/t_variables | 0 smoke/runtest.sh => tests/smoke/test.sh | 0 {substitution => tests/substitution}/main.fmf | 1 + .../runtest.sh => tests/substitution/test.sh | 0 28 files changed, 58 insertions(+), 212 deletions(-) delete mode 100644 func/Makefile delete mode 100644 func/PURPOSE delete mode 100644 login/Makefile delete mode 100644 login/PURPOSE delete mode 100644 login/main.fmf create mode 100644 plans/bash.fmf create mode 100644 plans/dash.fmf create mode 100644 plans/ksh.fmf create mode 100644 plans/main.fmf create mode 100644 plans/mksh.fmf create mode 100644 plans/zsh.fmf delete mode 100644 smoke/Makefile delete mode 100644 smoke/PURPOSE rename {func => tests/functions}/main.fmf (86%) rename func/runtest.sh => tests/functions/test.sh (100%) create mode 100644 tests/login/main.fmf rename {login => tests/login}/script.exp (100%) rename {login => tests/login}/ssh.exp (100%) rename login/runtest.sh => tests/login/test.sh (100%) rename {login => tests/login}/tst.sh (100%) rename main.fmf => tests/main.fmf (61%) rename {smoke => tests/smoke}/main.fmf (100%) rename {smoke => tests/smoke}/t_alias (100%) rename {smoke => tests/smoke}/t_conditionals (100%) rename {smoke => tests/smoke}/t_variables (100%) rename smoke/runtest.sh => tests/smoke/test.sh (100%) rename {substitution => tests/substitution}/main.fmf (98%) rename substitution/runtest.sh => tests/substitution/test.sh (100%) diff --git a/func/Makefile b/func/Makefile deleted file mode 100644 index 6acb07d..0000000 --- a/func/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# Makefile -# Author: Jan Scotka -# Location: - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2008 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/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -TOPLEVEL_NAMESPACE=/CoreOS -PACKAGE_NAME=bash -RELATIVE_PATH=sanity/func - -export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) -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) - chmod a+x ./runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - - -$(METADATA): Makefile - @touch $(METADATA) - @echo "Owner: Jan Scotka " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Description: Try shell basic functionality" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 2h" >> $(METADATA) - @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) - @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/func/PURPOSE b/func/PURPOSE deleted file mode 100644 index d641633..0000000 --- a/func/PURPOSE +++ /dev/null @@ -1 +0,0 @@ -Basic test of functions in Bourne-Again SHell, testing purpose for Test Container Project diff --git a/login/Makefile b/login/Makefile deleted file mode 100644 index a8bca8f..0000000 --- a/login/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/bash/Sanity/login-shell -# Description: the test creates user with bash as login shell and verified the user can log in and get th -# Author: Martin Kyral -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/bash/Sanity/login-shell -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE script.exp ssh.exp tst.sh - -.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: Martin Kyral " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: the test creates user with bash as login shell and verified the user can log in and get th" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 5m" >> $(METADATA) - @echo "RunFor: ksh zsh bash dash mksh pdksh" >> $(METADATA) - @echo "Requires: bash" >> $(METADATA) - @echo "Requires: expect" >> $(METADATA) - @echo "Requires: procps-ng" >> $(METADATA) - @echo "Requires: passwd" >> $(METADATA) - @echo "Requires: openssh-clients openssh-server" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2+" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/login/PURPOSE b/login/PURPOSE deleted file mode 100644 index bac1cd2..0000000 --- a/login/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /CoreOS/bash/Sanity/login-shell -Description: the test creates user with bash as login shell and verified the user can log in and get th -Author: Your Name diff --git a/login/main.fmf b/login/main.fmf deleted file mode 100644 index e542d93..0000000 --- a/login/main.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Basic login shell test -description: > - The test creates user with bash as login shell and - verifies that the user can log into the system. -tags: [classic] diff --git a/plans/bash.fmf b/plans/bash.fmf new file mode 100644 index 0000000..d3b5338 --- /dev/null +++ b/plans/bash.fmf @@ -0,0 +1,7 @@ +discover+: + filter: component:bash +prepare+: + package: bash +environment: + PACKAGES: bash + SH_BIN: bash diff --git a/plans/dash.fmf b/plans/dash.fmf new file mode 100644 index 0000000..216a4d0 --- /dev/null +++ b/plans/dash.fmf @@ -0,0 +1,7 @@ +discover+: + filter: component:dash +prepare+: + package: dash +environment: + PACKAGES: dash + SH_BIN: dash diff --git a/plans/ksh.fmf b/plans/ksh.fmf new file mode 100644 index 0000000..a4218fc --- /dev/null +++ b/plans/ksh.fmf @@ -0,0 +1,7 @@ +discover+: + filter: component:ksh +prepare+: + package: ksh +environment: + PACKAGES: ksh + SH_BIN: ksh diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..5449715 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,6 @@ +discover: + how: fmf +prepare: + how: install +execute: + how: tmt diff --git a/plans/mksh.fmf b/plans/mksh.fmf new file mode 100644 index 0000000..bb54e6e --- /dev/null +++ b/plans/mksh.fmf @@ -0,0 +1,7 @@ +discover+: + filter: component:mksh +prepare+: + package: mksh +environment: + PACKAGES: mksh + SH_BIN: mksh diff --git a/plans/zsh.fmf b/plans/zsh.fmf new file mode 100644 index 0000000..7c86e01 --- /dev/null +++ b/plans/zsh.fmf @@ -0,0 +1,7 @@ +discover+: + filter: component:zsh +prepare+: + package: zsh +environment: + PACKAGES: zsh + SH_BIN: zsh diff --git a/smoke/Makefile b/smoke/Makefile deleted file mode 100644 index 1e29977..0000000 --- a/smoke/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/bash/Sanity/smoke -# Description: Basic sanity smoke test -# Author: Miroslav Hradilek -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2012 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/bash/Sanity/smoke -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE t_alias t_conditionals t_variables - -.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: Miroslav Hradilek " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Basic sanity smoke test" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 5m" >> $(METADATA) - @echo "RunFor: bash" >> $(METADATA) - @echo "Requires: bash" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/smoke/PURPOSE b/smoke/PURPOSE deleted file mode 100644 index f393cb4..0000000 --- a/smoke/PURPOSE +++ /dev/null @@ -1,8 +0,0 @@ -PURPOSE of /CoreOS/bash/Sanity/smoke -Description: Basic sanity smoke test -Author: Miroslav Hradilek - -Performs basic sanity smoke test. Tries to supply commands on a -command line, variable assignment and substitution, file -expansion, "test" builtin, redirection, pipeline and some control -structures. diff --git a/func/main.fmf b/tests/functions/main.fmf similarity index 86% rename from func/main.fmf rename to tests/functions/main.fmf index 24c81bb..195b3f4 100644 --- a/func/main.fmf +++ b/tests/functions/main.fmf @@ -1,3 +1,3 @@ summary: Basic test of functions in Bourne-Again Shell -duration: 2h +duration: 15m component: [bash, ksh, mksh, zsh] diff --git a/func/runtest.sh b/tests/functions/test.sh similarity index 100% rename from func/runtest.sh rename to tests/functions/test.sh diff --git a/tests/login/main.fmf b/tests/login/main.fmf new file mode 100644 index 0000000..cdb00bf --- /dev/null +++ b/tests/login/main.fmf @@ -0,0 +1,12 @@ +summary: Basic login shell test +description: > + The test creates user with bash as login shell and + verifies that the user can log into the system. + Does not run in a container, needs full virtualization. +tag: [virtual] +require: + - expect + - procps-ng + - passwd + - openssh-clients + - openssh-server diff --git a/login/script.exp b/tests/login/script.exp similarity index 100% rename from login/script.exp rename to tests/login/script.exp diff --git a/login/ssh.exp b/tests/login/ssh.exp similarity index 100% rename from login/ssh.exp rename to tests/login/ssh.exp diff --git a/login/runtest.sh b/tests/login/test.sh similarity index 100% rename from login/runtest.sh rename to tests/login/test.sh diff --git a/login/tst.sh b/tests/login/tst.sh similarity index 100% rename from login/tst.sh rename to tests/login/tst.sh diff --git a/main.fmf b/tests/main.fmf similarity index 61% rename from main.fmf rename to tests/main.fmf index fccdf4a..c998160 100644 --- a/main.fmf +++ b/tests/main.fmf @@ -1,6 +1,7 @@ contact: Jakub Heger +test: ./test.sh +framework: beakerlib component: [bash, ksh, mksh, zsh, dash] -test: ./runtest.sh duration: 5m tier: 2 -tags: [classic, container, atomic] +tag: [virtual, container] diff --git a/smoke/main.fmf b/tests/smoke/main.fmf similarity index 100% rename from smoke/main.fmf rename to tests/smoke/main.fmf diff --git a/smoke/t_alias b/tests/smoke/t_alias similarity index 100% rename from smoke/t_alias rename to tests/smoke/t_alias diff --git a/smoke/t_conditionals b/tests/smoke/t_conditionals similarity index 100% rename from smoke/t_conditionals rename to tests/smoke/t_conditionals diff --git a/smoke/t_variables b/tests/smoke/t_variables similarity index 100% rename from smoke/t_variables rename to tests/smoke/t_variables diff --git a/smoke/runtest.sh b/tests/smoke/test.sh similarity index 100% rename from smoke/runtest.sh rename to tests/smoke/test.sh diff --git a/substitution/main.fmf b/tests/substitution/main.fmf similarity index 98% rename from substitution/main.fmf rename to tests/substitution/main.fmf index d1b5edf..b7f8701 100644 --- a/substitution/main.fmf +++ b/tests/substitution/main.fmf @@ -2,6 +2,7 @@ summary: Verify correct $$ parsing in command substitution description: | Parsing commands break when using $$ in command substitution $(..). Test for https://bugzilla.redhat.com/show_bug.cgi?id=1727952 +tier: 1 extra-nitrate: TC#0602870 extra-summary: /CoreOS/bash/Regression/bz1727952-Parsing-commands-break-when-using-in-command diff --git a/substitution/runtest.sh b/tests/substitution/test.sh similarity index 100% rename from substitution/runtest.sh rename to tests/substitution/test.sh