diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..394e003 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/teemtee/tmt.git + rev: 1.43.0 + hooks: + - id: tmt-lint \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/basic-sanity-test/Makefile b/basic-sanity-test/Makefile deleted file mode 100644 index 5051e76..0000000 --- a/basic-sanity-test/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/tomcat/Sanity/basic-sanity-test -# Description: Test tries if serving of HTML/JSP pages is okay -# Author: Jan Scotka -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/tomcat/Sanity/basic-sanity-test -export TESTVERSION=2.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 - @echo "Owner: Matus Madzin " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test tries if serving of HTML/JSP pages is okay" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 20m" >> $(METADATA) - @echo "RunFor: tomcat5 tomcat6" >> $(METADATA) - @echo "Requires: curl" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: yes" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "RhtsRequires: test(/CoreOS/tomcat/test-libs)" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/basic-sanity-test/framework.sh b/basic-sanity-test/framework.sh deleted file mode 100755 index d7a8a3b..0000000 --- a/basic-sanity-test/framework.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -# Include rhts environment -#. /usr/bin/rhts-environment.sh -. /usr/share/beakerlib/beakerlib.sh - -# Include functions.sh -. functions.sh - -tlRunTest() { - if __tlHasFunction tlTest; then - __tlRunTestSimple - else - __tlRunTestLoop - fi -} - -__tlRunTestSimple() { -rlJournalStart - - rlPhaseStartSetup - TOMCAT=$(__tlGetTomcat) - rlAssert0 "Tomcat installed: $TOMCAT" $? || rlDie "No tomcat installed, terminating" - tlTomcatStop - __tlHasFunction tlSetup && tlSetup - rlPhaseEnd - - if __tlHasFunction tlTest; then - rlPhaseStartTest - tlTest - rlPhaseEnd - fi - - if __tlHasFunction tlCleanup; then - rlPhaseStartCleanup - tlCleanup - rlPhaseEnd - fi - -rlJournalPrintText -rlJournalEnd -} - -__tlRunTestLoop() { -rlJournalStart - - rlPhaseStartSetup - TOMCAT=$(__tlGetTomcat) - rlAssert0 "Tomcat installed: $TOMCAT" $? || rlDie "No tomcat installed, terminating" - JAVAS=$(__tlGetJavas) - rlAssert0 "Javas installed: $JAVAS" $? || rlDie "No java installed, terminating" - tlTomcatStop - __tlTomcatBackup - __tlTomcatCleanCache - __tlHasFunction tlSetup && tlSetup - rlPhaseEnd - - for JAVA in $JAVAS; do - rlPhaseStart WARN "Setup for $JAVA" - __tlSetJavas $JAVA - __tlHasFunction tlSetupLoop && tlSetupLoop - rlPhaseEnd - - rlPhaseStart FAIL "Test for $JAVA" - __tlHasFunction tlTestLoop && tlTestLoop - rlPhaseEnd - - rlPhaseStart WARN "Cleanup for $JAVA" - tlTomcatStop - __tlTomcatRestore - __tlTomcatCleanCache - __tlHasFunction tlCleanupLoop && tlCleanupLoop - rlPhaseEnd - done - - if __tlHasFunction tlCleanup; then - rlPhaseStartCleanup - tlCleanup - rlPhaseEnd - fi - -rlJournalPrintText -rlJournalEnd -} diff --git a/basic-sanity-test/functions.sh b/basic-sanity-test/functions.sh deleted file mode 100755 index a7f61a8..0000000 --- a/basic-sanity-test/functions.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash - -__tlGetTomcat() { - for TOMCAT in tomcat tomcat6 tomcat5; do - rpm --quiet -q $TOMCAT && { echo $TOMCAT; return 0; } - done - return 1 -} - -__tlGetJavas() { - JREs=$(rpm --qf '%{NAME}\n' -qa | grep -E '^java-[0-9]{2}-(oracle|openjdk).*$' | grep "devel") - CODE=1 - for JRE in $JREs; do - rpm --quiet -q $JRE && { echo ${JRE%-devel}; CODE=0; } - done - return $CODE -} - -__tlGetArch() { - rpm --qf '%{ARCH}' -q $1 -} - -__tlGetVersion() { - rpm --qf '%{VERSION}' -q $1 -} - -__tlGetNVRA() { - rpm --qf '%{NVRA}' -q $1 -} - -__tlSetJavas() { - JAVA=$1 - JRE=jre-${JAVA#java-} - VERSION=$(__tlGetVersion $JAVA) - ARCH=$(uname -i) - NVRA=$(__tlGetNVRA $JAVA) - { alternatives --set java /usr/lib/jvm/$JRE.$ARCH/bin/java || \ - alternatives --set java /usr/lib/jvm/$JRE/bin/java || \ - alternatives --set java /usr/lib/jvm/$JRE-$VERSION.$ARCH/bin/java || \ - alternatives --set java /usr/lib/jvm/$JAVA-$VERSION.$(uname -i)/jre/bin/java || \ - alternatives --set java /usr/lib/jvm/$JAVA/bin/java || \ - alternatives --set java /usr/lib/jvm/$NVRA/bin/java || \ - alternatives --set java /usr/lib/jvm/$NVRA/jre/bin/java; } && \ - { alternatives --set javac /usr/lib/jvm/$JAVA.$ARCH/bin/javac || \ - alternatives --set javac /usr/lib/jvm/$JAVA/bin/javac || \ - alternatives --set javac /usr/lib/jvm/$JAVA-$VERSION.$(uname -i)/bin/javac || \ - alternatives --set javac /usr/lib/jvm/$NVRA/bin/javac; } - - { alternatives --display java | grep "link currently points to" | grep $JRE || \ - alternatives --display java | grep "link currently points to" | grep $JAVA; } && \ - { alternatives --display javac | grep "link currently points to" | grep $JAVA; } - - rlAssert0 "Setting javas to $JAVA" $? -} - -__tlService() { - ACTION=$1 - SERVICE=$2 - SLEEP=${3:-0} - eval rlService$ACTION $SERVICE - rlAssert0 "$ACTION $SERVICE" $? - [ $SLEEP -gt 0 ] && { rlLog "Sleep for $SLEEP seconds"; sleep $SLEEP; } -} - -tlServiceStart() { - __tlService Start $* -} - -tlServiceStop() { - __tlService Stop $* -} - -tlServiceRestore() { - __tlServiceRestore $* -} - -#__tlTomcat() { -# ACTION=$1 -# eval rlService$ACTION $TOMCAT -# rlAssert0 "$ACTION $TOMCAT" $? -# [ $# -gt 1 ] && { rlLog "Sleep for $2 seconds"; sleep $2; } -#} - -__tlTomcatBackup() { - rlFileBackup --clean --namespace $TOMCAT /etc/$TOMCAT /etc/sysconfig/$TOMCAT /var/lib/$TOMCAT /var/log/$TOMCAT - rlAssert0 "Backing up $TOMCAT config, webapps and logs" $? -} - -__tlTomcatCleanCache() { - rlRun "rm -rf /var/cache/$TOMCAT/work/* /var/cache/$TOMCAT/temp/*" 0 "Cleaning $TOMCAT cache" -} - -__tlTomcatRestore() { - rlFileRestore --namespace $TOMCAT - rlAssert0 "Restoring backed-up files" $? -} - -__tlHasFunction() { - [ "$(type -t "$1")" = "function" ] || return 1 -} - -tlTomcatStart() { - tlServiceStart $TOMCAT $* -} - -tlTomcatStop() { - tlServiceStop $TOMCAT $* -} - -tlTomcatRestore() { - tlServiceRestore $TOMCAT $* -} diff --git a/basic-sanity-test/main.fmf b/basic-sanity-test/main.fmf deleted file mode 100644 index 2e9a16b..0000000 --- a/basic-sanity-test/main.fmf +++ /dev/null @@ -1,19 +0,0 @@ -summary: Test tries if serving of HTML/JSP pages is okay -description: '' -contact: Matus Madzin -component: - - tomcat9 -test: ./runtest.sh -framework: beakerlib -require: - - tomcat - - java-21-openjdk-devel - - hostname -recommend: - - curl -duration: 20m -tag: -- Tier1 -tier: '1' -extra-summary: /CoreOS/tomcat/rhel9/basic-sanity-test -extra-task: /CoreOS/tomcat/rhel9/basic-sanity-test diff --git a/basic-sanity-test/resources/sample.war b/basic-sanity-test/resources/sample.war deleted file mode 100644 index 0a127e6..0000000 Binary files a/basic-sanity-test/resources/sample.war and /dev/null differ diff --git a/basic-sanity-test/resources/tomcat-users.xml b/basic-sanity-test/resources/tomcat-users.xml deleted file mode 100644 index afa0f76..0000000 --- a/basic-sanity-test/resources/tomcat-users.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/basic-sanity-test/resources/webapps.tar.gz b/basic-sanity-test/resources/webapps.tar.gz deleted file mode 100644 index c4d2251..0000000 Binary files a/basic-sanity-test/resources/webapps.tar.gz and /dev/null differ diff --git a/basic-sanity-test/runtest.sh b/basic-sanity-test/runtest.sh deleted file mode 100755 index 7a0bea5..0000000 --- a/basic-sanity-test/runtest.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/tomcat/Sanity/basic-sanity-test -# Description: Test tries if serving of HTML/JSP pages is okay -# Author: Jan Scotka -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include tomcat-test-libs framework -TOMCAT="tomcat" -. framework.sh - -tlSetup() { - rlAssertRpm curl - #WEBAPPS=no - #rlCheckRpm $TOMCAT-webapps && WEBAPPS=yes - HOSTNAME=$(hostname) - #if [ $TOMCAT = tomcat5 ] && [ $WEBAPPS = yes ]; then - # SERVLETEXAMPLES="servlets-examples/servlet" - # JSPEXAMPLES="jsp-examples/jsp2" - #else - SERVLETEXAMPLES="examples/servlets/servlet" - JSPEXAMPLES="examples/jsp/jsp2" - #fi -} - -tlSetupLoop() { - #[ $WEBAPPS = yes ] || rlRun "tar -C /var/lib/$TOMCAT/webapps -zxf ../../test-libs/resources/webapps.tar.gz" 0 "Package $TOMCAT-webapps not found, unpacking example webapps" - rlRun "tar -C /var/lib/$TOMCAT/webapps -zxf resources/webapps.tar.gz" 0 "Unpacking example webapps" - rlRun "cp resources/sample.war /var/lib/$TOMCAT/webapps" 0 "Copying sample webapp" - tlTomcatStart 10 -} - -tlTestLoop() { - rlLog "hostname is set to $HOSTNAME" - if [ ! $TOMCAT = tomcat5 ]; then - rlRun "curl http://$HOSTNAME:8080 |grep '\$CATALINA_HOME/webapps/ROOT/index.html'" 0 "tomcat is serving default HTML $TOMCAT page" - fi - rlRun "curl http://$HOSTNAME:8080/index.jsp |grep '\$CATALINA_HOME/webapps/ROOT/index.jsp'" 0 "tomcat is serving default JSP $TOMCAT page" - - rlLog "testing deployed WAR archive with sample jsp and servlet app" - rlRun "curl http://$HOSTNAME:8080/sample/ |grep '

Sample \"Hello, World\" Application'" 0 "sample Hello World application" - rlRun "curl http://$HOSTNAME:8080/sample/hello.jsp |grep '

Sample Application JSP Page'" 0 "sample JSP page" - rlRun "curl http://$HOSTNAME:8080/sample/hello |grep '

Sample Application Servlet'" 0 "sample servlet" - - rlLog "Servlet examples" - rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/HelloWorldExample |grep 'Hello World!'" 0 " Trivial Hello world servlet " - rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/RequestInfoExample |grep \"/$SERVLETEXAMPLES/RequestInfoExample\"" 0 " Request info example " - rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/RequestHeaderExample |grep \"$HOSTNAME:8080\"" 0 " Request header info, should be sent $HOSTNAME " - rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/RequestParamExample -d firstname=xxxx -d lastname=yyyy |egrep '(xxxx|yyyy)' |wc -l |grep 2" 0 " parsing POST parameters correctly " - - rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/CookieExample -d cookiename=cccc -d cookievalue=dddd -b aaaa=bbbb |egrep '(aaaa.+bbbb|cccc.+dddd)'|wc -l |grep 2" 0 " processing of cookies " - #rlRun "curl http://$HOSTNAME:8080/$SERVLETEXAMPLES/SessionExample?dataname=ggg&datavalue=hhh |egrep 'jsessionid'" 0 " session ID finding (not working with curl :-)" - - rlLog "JSP examples" - rlRun "curl http://$HOSTNAME:8080/$JSPEXAMPLES/simpletag/hello.jsp | grep 'Hello, world!'" 0 " At least one JSP example, should return Hellow world" -} - -tlRunTest diff --git a/deploy-javaee-war/javaee.war b/deploy-javaee-war/javaee.war new file mode 100644 index 0000000..f3b6b6a Binary files /dev/null and b/deploy-javaee-war/javaee.war differ diff --git a/deploy-javaee-war/main.fmf b/deploy-javaee-war/main.fmf new file mode 100644 index 0000000..5a3dc53 --- /dev/null +++ b/deploy-javaee-war/main.fmf @@ -0,0 +1,4 @@ +summary: Tomcat deploy Javaee war test. Checks our migration tool works as expected. +description: Start Tomcat as a service. Check it deploys successfully the javaee war by making a call to /hello path. Stop Tomcat. +require+: + - curl diff --git a/deploy-javaee-war/test.sh b/deploy-javaee-war/test.sh new file mode 100755 index 0000000..1ff4754 --- /dev/null +++ b/deploy-javaee-war/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +CATALINA_BASE=/var/lib/tomcat + +rlJournalStart + + rlPhaseStartSetup "Pre-Test Environment Setup" + rlRun "cp javaee.war ${CATALINA_BASE}/webapps-javaee" 0 "Copying sample webapp" + rlLog "Starting Tomcat service" + rlServiceStart tomcat + rlPhaseEnd + + rlPhaseStartTest "Verify Tomcat Service Functionality" + # Wait until Tomcat is ready on localhost:8080 + rlLog "Waiting for Tomcat to become responsive on port 8080" + for i in {1..10}; do + if curl -s http://localhost:8080/ >/dev/null; then + rlLog "Tomcat is up after ${i} seconds" + break + else + sleep 1 + fi + done + rlLog "Checking that javaee webapp exists" + rlAssertExists ${CATALINA_BASE}/webapps/javaee + rlRun "curl http://localhost:8080/javaee/hello | grep '

Hello, World! This is a Javaee Servlet!'" 0 "Sample servlet" + rlPhaseEnd + + rlPhaseStartCleanup "Post-Test Teardown" + rlLog "Stopping Tomcat service" + rlServiceStop tomcat + rlPhaseEnd + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file diff --git a/deploy-war/jakartahelloworld.war b/deploy-war/jakartahelloworld.war new file mode 100644 index 0000000..a76c951 Binary files /dev/null and b/deploy-war/jakartahelloworld.war differ diff --git a/deploy-war/main.fmf b/deploy-war/main.fmf new file mode 100644 index 0000000..46818ab --- /dev/null +++ b/deploy-war/main.fmf @@ -0,0 +1,4 @@ +summary: Tomcat deploy Jakarta war test. +description: Start Tomcat as a service. Check it deploys successfully the war by making a call to /hello path. Stop Tomcat. +require+: + - curl diff --git a/deploy-war/test.sh b/deploy-war/test.sh new file mode 100755 index 0000000..aa5c9a6 --- /dev/null +++ b/deploy-war/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +CATALINA_BASE=/var/lib/tomcat + +rlJournalStart + + rlPhaseStartSetup "Pre-Test Environment Setup" + rlRun "cp jakartahelloworld.war ${CATALINA_BASE}/webapps" 0 "Copying sample webapp" + rlLog "Starting Tomcat service" + rlServiceStart tomcat + rlPhaseEnd + + rlPhaseStartTest "Verify Tomcat Service Functionality" + # Wait until Tomcat is ready on localhost:8080 + rlLog "Waiting for Tomcat to become responsive on port 8080" + for i in {1..10}; do + if curl -s http://localhost:8080/ >/dev/null; then + rlLog "Tomcat is up after ${i} seconds" + break + else + sleep 1 + fi + done + rlLog "Checking that jakartahelloworld webapp exists" + rlAssertExists ${CATALINA_BASE}/webapps/jakartahelloworld + rlRun "curl http://localhost:8080/jakartahelloworld/hello | grep '

Hello, World! This is a Jakarta Servlet!'" 0 "Sample servlet" + rlPhaseEnd + + rlPhaseStartCleanup "Post-Test Teardown" + rlLog "Stopping Tomcat service" + rlServiceStop tomcat + rlPhaseEnd + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file diff --git a/directory-structure/main.fmf b/directory-structure/main.fmf new file mode 100644 index 0000000..583d28d --- /dev/null +++ b/directory-structure/main.fmf @@ -0,0 +1,7 @@ +summary: Tomcat directory structure test +description: Makes sure that Tomcat home directory has expected structure and that there are no dangling symlinks there. +require+: + - tomcat-user-instance + - tomcat-webapps + - tomcat-admin-webapps + - tomcat-docs-webapp diff --git a/directory-structure/test.sh b/directory-structure/test.sh new file mode 100755 index 0000000..50972fb --- /dev/null +++ b/directory-structure/test.sh @@ -0,0 +1,207 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +CATALINA_HOME=/usr/share/tomcat +CATALINA_BASE=/var/lib/tomcat + +rlJournalStart + + rlPhaseStartTest "Check CATALINA_HOME directory structure" + rlAssertExists ${CATALINA_HOME}/ + rlAssertExists ${CATALINA_HOME}/bin/ + rlAssertExists ${CATALINA_HOME}/bin/bootstrap.jar + rlAssertExists ${CATALINA_HOME}/bin/tomcat-juli.jar + rlAssertExists ${CATALINA_HOME}/bin/catalina.sh + rlAssertExists ${CATALINA_HOME}/bin/catalina-tasks.xml + rlAssertExists ${CATALINA_HOME}/bin/ciphers.sh + rlAssertExists ${CATALINA_HOME}/bin/configtest.sh + rlAssertExists ${CATALINA_HOME}/bin/digest.sh + rlAssertExists ${CATALINA_HOME}/bin/makebase.sh + rlAssertExists ${CATALINA_HOME}/bin/migrate.sh + rlAssertExists ${CATALINA_HOME}/bin/setclasspath.sh + rlAssertExists ${CATALINA_HOME}/bin/shutdown.sh + rlAssertExists ${CATALINA_HOME}/bin/startup.sh + rlAssertExists ${CATALINA_HOME}/bin/tool-wrapper.sh + rlAssertExists ${CATALINA_HOME}/bin/version.sh + rlAssertExists ${CATALINA_HOME}/doc/ + rlAssertExists ${CATALINA_HOME}/doc/RUNNING.txt + rlAssertExists ${CATALINA_HOME}/lib/ + + rlAssertExists ${CATALINA_HOME}/user-instance/ + rlAssertExists ${CATALINA_HOME}/user-instance/bin/ + rlAssertExists ${CATALINA_HOME}/user-instance/bin/setenv.sh + rlAssertExists ${CATALINA_HOME}/user-instance/conf/ + rlAssertExists ${CATALINA_HOME}/user-instance/conf/catalina.policy + rlAssertExists ${CATALINA_HOME}/user-instance/conf/catalina.properties + rlAssertExists ${CATALINA_HOME}/user-instance/conf/context.xml + rlAssertExists ${CATALINA_HOME}/user-instance/conf/jaspic-providers.xml + rlAssertExists ${CATALINA_HOME}/user-instance/conf/logging.properties + rlAssertExists ${CATALINA_HOME}/user-instance/conf/server.xml + rlAssertExists ${CATALINA_HOME}/user-instance/conf/tomcat-users.xml + rlAssertExists ${CATALINA_HOME}/user-instance/conf/web.xml + rlPhaseEnd + + rlPhaseStartTest "Check CATALINA_BASE directory structure" + rlAssertExists ${CATALINA_BASE}/ + rlAssertExists ${CATALINA_BASE}/conf/ + rlAssertExists ${CATALINA_BASE}/logs/ + rlAssertExists ${CATALINA_BASE}/webapps/ + rlAssertExists ${CATALINA_BASE}/webapps/docs/ + rlAssertExists ${CATALINA_BASE}/webapps/host-manager/ + rlAssertExists ${CATALINA_BASE}/webapps/manager/ + rlAssertExists ${CATALINA_BASE}/webapps/ROOT/ + rlAssertExists ${CATALINA_BASE}/work/ + rlPhaseEnd + + rlPhaseStartTest "Check configuration directory structure" + rlAssertExists /etc/tomcat/ + rlAssertExists /etc/tomcat/catalina.policy + rlAssertExists /etc/tomcat/catalina.properties + rlAssertExists /etc/tomcat/context.xml + rlAssertExists /etc/tomcat/jaspic-providers.xml + rlAssertExists /etc/tomcat/logging.properties + rlAssertExists /etc/tomcat/server.xml + rlAssertExists /etc/tomcat/tomcat-users.xml + rlAssertExists /etc/tomcat/web.xml + rlAssertExists /etc/tomcat/Catalina/ + rlAssertExists /etc/tomcat/Catalina/localhost + rlAssertExists /etc/tomcat/conf.d/ + rlAssertExists /etc/tomcat/conf.d/README + rlPhaseEnd + + rlPhaseStartTest "Check user instance script" + rlAssertExists /usr/bin/tomcat-user-instance-create + rlPhaseEnd + + rlPhaseStartTest "Check systemd and sysusers" + rlAssertExists /usr/lib/systemd/system/tomcat.service + rlAssertExists /usr/lib/sysusers.d/tomcat.conf + rlPhaseEnd + + rlPhaseStartTest "Check libexec scripts" + rlAssertExists /usr/libexec/tomcat/tomcat-locate-java.sh + rlAssertExists /usr/libexec/tomcat/tomcat-run.sh + rlPhaseEnd + + rlPhaseStartTest "Check libraries" + rlAssertExists /usr/share/java/tomcat/ + rlAssertExists /usr/share/java/tomcat/annotations-api.jar + rlAssertExists /usr/share/java/tomcat/catalina-storeconfig.jar + rlAssertExists /usr/share/java/tomcat/jasper-el.jar + rlAssertExists /usr/share/java/tomcat/tomcat-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-jdbc.jar + rlAssertExists /usr/share/java/tomcat/tomcat-util.jar + rlAssertExists /usr/share/java/tomcat/catalina-ant.jar + rlAssertExists /usr/share/java/tomcat/catalina-tribes.jar + rlAssertExists /usr/share/java/tomcat/jasper.jar + rlAssertExists /usr/share/java/tomcat/tomcat-bootstrap.jar + rlAssertExists /usr/share/java/tomcat/tomcat-jni.jar + rlAssertExists /usr/share/java/tomcat/tomcat-util-scan.jar + rlAssertExists /usr/share/java/tomcat/catalina-ha.jar + rlAssertExists /usr/share/java/tomcat/ecj-x.jar + rlAssertExists /usr/share/java/tomcat/jaspic-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-coyote.jar + rlAssertExists /usr/share/java/tomcat/tomcat-jsp-3.1-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-websocket.jar + rlAssertExists /usr/share/java/tomcat/catalina.jar + rlAssertExists /usr/share/java/tomcat/el-api.jar + rlAssertExists /usr/share/java/tomcat/jsp-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-dbcp.jar + rlAssertExists /usr/share/java/tomcat/tomcat-juli.jar + rlAssertExists /usr/share/java/tomcat/websocket-api.jar + rlAssertExists /usr/share/java/tomcat/catalina-ssi.jar + rlAssertExists /usr/share/java/tomcat/jakartaee-migration-x.jar + rlAssertExists /usr/share/java/tomcat/servlet-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-el-6.0-api.jar + rlAssertExists /usr/share/java/tomcat/tomcat-servlet-6.0-api.jar + rlAssertExists /usr/share/java/tomcat/websocket-client-api.jar + + rlAssertExists /usr/share/java/tomcat-el-6.0-api.jar + rlAssertExists /usr/share/java/tomcat-el-api.jar + rlAssertExists /usr/share/java/tomcat-jsp-3.1-api.jar + rlAssertExists /usr/share/java/tomcat-jsp-api.jar + rlAssertExists /usr/share/java/tomcat-servlet-6.0-api.jar + rlAssertExists /usr/share/java/tomcat-servlet-api.jar + + rlAssertExists /usr/lib/java/tomcat/tomcat-jni.jar + + rlAssertNotExists /usr/share/java/tomcat/tomcat-coyote-ffm.jar + rlPhaseEnd + + rlPhaseStartTest "Check tomcat-common docs" + rlAssertExists /usr/share/doc/tomcat-common/NOTICE + rlAssertExists /usr/share/doc/tomcat-common/RELEASE-NOTES + rlPhaseEnd + + rlPhaseStartTest "Check licenses" + rlAssertExists /usr/share/licenses/tomcat/LICENSE + rlAssertExists /usr/share/licenses/tomcat-admin-webapps/LICENSE + rlAssertExists /usr/share/licenses/tomcat-common/LICENSE + rlAssertExists /usr/share/licenses/tomcat-docs-webapp/LICENSE + rlAssertExists /usr/share/licenses/tomcat-el-5.0-api/LICENSE + rlAssertExists /usr/share/licenses/tomcat-jsp-3.1-api/LICENSE + rlAssertExists /usr/share/licenses/tomcat-servlet-6.0-api/LICENSE + rlAssertExists /usr/share/licenses/tomcat-lib/LICENSE + rlAssertExists /usr/share/licenses/tomcat-user-instance/LICENSE + rlAssertExists /usr/share/licenses/tomcat-webapps/LICENSE + rlPhaseEnd + + rlPhaseStartTest "Check user instance man page" + rlAssertExists /usr/share/man/man1/tomcat-user-instance-create.1.gz + rlPhaseEnd + + rlPhaseStartTest "Check maven metadata" + rlAssertExists /usr/share/maven-metadata/tomcat.xml + rlAssertExists /usr/share/maven-metadata/tomcat-tomcat-common.xml + rlAssertExists /usr/share/maven-metadata/tomcat-tomcat-el-api.xml + rlAssertExists /usr/share/maven-metadata/tomcat-tomcat-jsp-api.xml + rlAssertExists /usr/share/maven-metadata/tomcat-tomcat-servlet-api.xml + rlPhaseEnd + + rlPhaseStartTest "Check maven poms" + rlAssertExists /usr/share/maven-poms/tomcat/ + rlAssertExists /usr/share/maven-poms/tomcat/annotations-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina-storeconfig.pom + rlAssertExists /usr/share/maven-poms/tomcat/jasper-el.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-jdbc.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-util.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina-ant.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina-tribes.pom + rlAssertExists /usr/share/maven-poms/tomcat/jasper.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-jni.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-util-scan.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina-ha.pom + rlAssertExists /usr/share/maven-poms/tomcat/jaspic-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-coyote.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-jsp-3.1-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-websocket.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina.pom + rlAssertExists /usr/share/maven-poms/tomcat/el-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/jsp-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-dbcp.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-juli.pom + rlAssertExists /usr/share/maven-poms/tomcat/websocket-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/catalina-ssi.pom + rlAssertExists /usr/share/maven-poms/tomcat/servlet-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-el-6.0-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-servlet-6.0-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/websocket-client-api.pom + rlAssertExists /usr/share/maven-poms/tomcat/tomcat.pom + + rlAssertExists /usr/share/maven-poms/tomcat-el-6.0-api.pom + rlAssertExists /usr/share/maven-poms/tomcat-el-api.pom + rlAssertExists /usr/share/maven-poms/tomcat-jsp-3.1-api.pom + rlAssertExists /usr/share/maven-poms/tomcat-jsp-api.pom + rlAssertExists /usr/share/maven-poms/tomcat-servlet-6.0-api.pom + rlAssertExists /usr/share/maven-poms/tomcat-servlet-api.pom + + rlAssertExists /usr/share/maven-poms/tomcat/tomcat-jni.pom + rlPhaseEnd + + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file diff --git a/ipv6-sanity-test/Makefile b/ipv6-sanity-test/Makefile deleted file mode 100644 index f2a29c7..0000000 --- a/ipv6-sanity-test/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/tomcat/Multihost/ipv6-sanity-test -# Description: Tests if tomcat basically work with IPv6 -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/tomcat/Multihost/ipv6-sanity-test -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE functions.sh ipv6calc-0.73.0.tar.gz sample.war - -.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 - @echo "Owner: Martin Cermak " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Tests if tomcat basically work with IPv6" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 70m" >> $(METADATA) - @echo "RunFor: tomcat6" >> $(METADATA) - @echo "Requires: tomcat6 iptables iptables-ipv6 gcc make bind bind-utils" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/ipv6-sanity-test/Runtest.xml b/ipv6-sanity-test/Runtest.xml deleted file mode 100644 index d15e483..0000000 --- a/ipv6-sanity-test/Runtest.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - /CoreOS/tomcat/Multihost/ipv6-sanity-test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ipv6-sanity-test/functions.sh b/ipv6-sanity-test/functions.sh deleted file mode 100755 index d8c1593..0000000 --- a/ipv6-sanity-test/functions.sh +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# functions.sh of /CoreOS/tomcat/Multihost/ipv6-sanity-test -# Description: Tests if tomcat basically work with IPv6 -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# define ports nc will use to transfer IPv6 from server to client and vice-versa -MYPORT1=26000 -MYPORT2=26001 - -# define ipv6calc currently used -IPV6CALC="ipv6calc-0.73.0" - -# returns IPv6 address for given DN USING NAMESERVERS from resolv.conf -function dn2ip6() { - for i in `grep ^nameserver /etc/resolv.conf | awk '{print $2}'`; do - dig +short @$i $1 AAAA; - done | grep -v ^$ | head -n 1 -} - -# returns public IPv6 of local machine -function getMyPublicIp6() { - ifconfig | egrep 'inet6.*(Scope:Global|Scope:Site)' | sed "s/\//\ /g" | awk '{print $3}' | head -n 1 -} - -# returns the length of the network prefix part of the local machine's public IPv6 address -function getMyPublicIp6NetPrefixLength() { - ifconfig | egrep 'inet6.*(Scope:Global|Scope:Site)' | sed "s/\//\ /g" | awk '{print $4}' | head -n 1 -} - -# returns public IPv4 address of the local machine -function getMyPublicIp4() { - ifconfig | grep "inet addr" | grep -v "127.0.0.1" | sed "s/:/\ /g" | awk '{print $3}' | head -n 1 -} - -# sets up a server which publishes the IPv6 on $MYPORT1 -function exposeMyPublicIp6() { - rlRun "echo `getMyPublicIp6` | nc -l `getMyPublicIp4` $MYPORT1 &" - rlRun "echo `getMyPublicIp6` | nc -l `getMyPublicIp6` $MYPORT1 &" -} - -# sets up a server which publishes the network prefix of the IPv6 on $MYPORT2 -function exposeMyPublicIp6NetPrefixLength() { - rlRun "echo `getMyPublicIp6NetPrefixLength` | nc -l `getMyPublicIp4` $MYPORT2 &" - rlRun "echo `getMyPublicIp6NetPrefixLength` | nc -l `getMyPublicIp6` $MYPORT2 &" -} - -# returns IPv6 of the client -function retreiveClientsIp6() { - nc $CLIENTS $MYPORT1 -} - -# returns IPv6 of the server -function retreiveServersIp6() { - nc $SERVERS $MYPORT1 -} - -# returns network prefix length of the client's IPv6 -function retreiveClientsIp6NetPrefixLength() { - nc $CLIENTS $MYPORT2 -} - -# returns network prefix length of the server's IPv6 -function retreiveServersIp6NetPrefixLength() { - nc $SERVERS $MYPORT2 -} - -# returns domain for given fqdn -function getDomain() { - echo $1 | sed "s/[^\.]\+\.\(.*\)/\1/g" -} - -# returns hostname for given fqdn -function getHostname() { - echo $1 | sed "s/\([^\.]\+\)\..*/\1/g" -} - -# returns something like 1.0.0.0.0.0.0.0.0.0.a.0.2.0.0.2.ip6.arpa. for given __IPv6__ addr and __NETWORK_PREFIX__ -function getRevnibblesArpa() { - ipv6calc -I ipv6addr -O revnibbles.arpa $1/$2 -} - -# returns something like a.1.1.1.9.f.e.f.f.f.2.7.3.1.2.0 for given __IPv6__ addr and __NETWORK_PREFIX__ -function getHost6DottedAddr() { - STR1=`ipv6calc -I ipv6addr -O revnibbles.arpa $1` - STR2=`ipv6calc -I ipv6addr -O revnibbles.arpa $1/$2` - echo $STR1 | sed "s/.$STR2//g" -} - -# show current settings -function showCurrentSettings() { - rlLog "SERVERS=$SERVERS" - rlLog "SERVERHOST=$SERVERHOST" - rlLog "SERVERDOMAIN=$SERVERDOMAIN" - rlLog "SERVERIPV6=$SERVERIPV6" - rlLog "SERVERIPV6NETPREFIXLEN=$SERVERIPV6NETPREFIXLEN" - rlLog "SERVERADDRREVDOT=$SERVERADDRREVDOT" - rlLog "SERVERARPA=$SERVERARPA" - - rlLog "CLIENTS=$CLIENTS" - rlLog "CLIENTHOST=$CLIENTHOST" - rlLog "CLIENTDOMAIN=$CLIENTDOMAIN" - rlLog "CLIENTIPV6=$CLIENTIPV6" - rlLog "CLIENTIPV6NETPREFIXLEN=$CLIENTIPV6NETPREFIXLEN" - rlLog "CLIENTADDRREVDOT=$CLIENTADDRREVDOT" - rlLog "CLIENTARPA=$CLIENTARPA" -} - -# check if initial conditions are met -function performInitialChecks() { - [ "$SERVERIPV6NETPREFIXLEN" == "$CLIENTIPV6NETPREFIXLEN" ] && \ - rlLog "Server and client IPv6 network prefix lengths are equal." || \ - rlDie "ERROR: Server and client IPv6 network prefix lengths differ." - [ "$SERVERARPA" == "$CLIENTARPA" ] && \ - rlLog "Server and client have the same ipv6.arpa" || \ - rlDie "ERROR: Server and client ipv6.arpa differ." -} - -# compile a simple tool for IPv6 transformations -function compileIpv6Calc() { - if which ipv6calc; then - rlLog "Binary ipv6calc is available, no need to compile" - else - rlRun "which gcc || yum -y install gcc" - rlRun "which make || yum -y install make" - rlRun "cp $ORIGPWD/$IPV6CALC.tar.gz ./" - rlRun "tar xvzf $IPV6CALC.tar.gz" - rlRun "cd $IPV6CALC" - rlRun "./configure > /dev/null && make > /dev/null && make install > /dev/null" - rlRun "cd .." - rlLog "`ipv6calc --help`" - rlRun "which ipv6calc" - fi; -} - -# removes trailing dot. -function removeTrailingDot() { - echo $1 | sed "s/\.$//" -} - -# sets up a nameserver with AAAA recorde of server and client, which also answers reverse queries -function setUpNameserver() { - rpm -qa | grep bind-chroot && yum -y remove bind-chroot - - rlAssertRpm "bind" - rlAssertRpm "bind-utils" - - rlFileBackup "/etc/named.conf" - -cat < /etc/named.conf -options { - listen-on port 53 { any; }; - listen-on-v6 port 53 { any; }; - directory "/var/named"; - allow-query { any; }; - recursion no; -}; - -zone "$SERVERDOMAIN" IN { - type master; - file "$SERVERDOMAIN.zone"; - allow-update { none; }; -}; - -zone "`removeTrailingDot $SERVERARPA`" IN { - type master; - file "$SERVERDOMAIN.rr.zone"; - allow-update { none; }; -}; -AEOF - - chown root:named /etc/named.conf - chmod 0640 /etc/named.conf - -cat < /var/named/$SERVERDOMAIN.zone -\$ORIGIN $SERVERDOMAIN. -\$TTL 86400 -@ IN SOA $SERVERS. $SERVERS. ( - 1 ; serial - 21600 ; refresh after 6 hours - 3600 ; retry after 1 hour - 604800 ; expire after 1 week - 86400 ) ; minimum TTL of 1 day - - IN NS $SERVERS. - - IN MX 10 $SERVERS. - - IN AAAA $SERVERIPV6 - -$SERVERHOST IN AAAA $SERVERIPV6 -$CLIENTHOST IN AAAA $CLIENTIPV6 -BEOF - - chown root:named /var/named/$SERVERDOMAIN.zone - chmod 0640 /var/named/$SERVERDOMAIN.zone - -cat < /var/named/$SERVERDOMAIN.rr.zone -\$ORIGIN $SERVERARPA -\$TTL 86400 -@ IN SOA $SERVERS. $SERVERS. ( - 1 ; serial - 21600 ; refresh after 6 hours - 3600 ; retry after 1 hour - 604800 ; expire after 1 week - 86400 ) ; minimum TTL of 1 day - - IN NS $SERVERS. - -$SERVERADDRREVDOT IN PTR $SERVERS. -$CLIENTADDRREVDOT IN PTR $CLIENTS. -CEOF - - chown root:named /var/named/$SERVERDOMAIN.rr.zone - chmod 0640 /var/named/$SERVERDOMAIN.rr.zone - - rlServiceStart named -} - -# common setup wrapper function -function prepareCommon() { - rlLog "Server: $SERVERS" - rlLog "Client: $CLIENTS" - rlRun "SERVERHOST=`getHostname $SERVERS`" - rlRun "SERVERDOMAIN=`getDomain $SERVERS`" - rlRun "CLIENTHOST=`getHostname $CLIENTS`" - rlRun "CLIENTDOMAIN=`getDomain $CLIENTS`" - rlRun "service iptables stop" 0-255 - rlRun "service ip6tables stop" 0-255 - rlRun "killall -9 nc" 0-255 - rlRun "exposeMyPublicIp6" - rlRun "exposeMyPublicIp6NetPrefixLength" - rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" - rlRun "ORIGPWD=`pwd`" - rlRun "pushd $TmpDir" - compileIpv6Calc -} - -# basic setup test -function basicSetupTest() { - rlRun "ping6 -c 1 $SERVERS" - rlRun "ping6 -c 1 $CLIENTS" - rlRun "ping6 -c 1 $SERVERIPV6" - rlRun "ping6 -c 1 $CLIENTIPV6" - rlRun "host -6 $SERVERS" - rlRun "host -6 $CLIENTS" - rlRun "host -6 $SERVERIPV6" - rlRun "host -6 $CLIENTIPV6" - rlRun "dig -6 +short @$SERVERIPV6 $SERVERS AAAA" - rlRun "dig -6 +short @$SERVERIPV6 $CLIENTS AAAA" - rlRun "dig +short @$SERVERS $SERVERS AAAA" - rlRun "dig +short @$SERVERS $CLIENTS AAAA" -} - -# set server variables -function setServerVars() { - SERVERIPV6=`getMyPublicIp6` - SERVERIPV6NETPREFIXLEN=`getMyPublicIp6NetPrefixLength` - SERVERADDRREVDOT=`getHost6DottedAddr $SERVERIPV6 $SERVERIPV6NETPREFIXLEN` - SERVERARPA=`getRevnibblesArpa $SERVERIPV6 $SERVERIPV6NETPREFIXLEN` - CLIENTIPV6=`retreiveClientsIp6` - CLIENTIPV6NETPREFIXLEN=`retreiveClientsIp6NetPrefixLength` - CLIENTADDRREVDOT=`getHost6DottedAddr $CLIENTIPV6 $CLIENTIPV6NETPREFIXLEN` - CLIENTARPA=`getRevnibblesArpa $CLIENTIPV6 $CLIENTIPV6NETPREFIXLEN` -} - -# set client variables -function setClientVars() { - SERVERIPV6=`retreiveServersIp6` - SERVERIPV6NETPREFIXLEN=`retreiveServersIp6NetPrefixLength` - SERVERADDRREVDOT=`getHost6DottedAddr $SERVERIPV6 $SERVERIPV6NETPREFIXLEN` - SERVERARPA=`getRevnibblesArpa $SERVERIPV6 $SERVERIPV6NETPREFIXLEN` - CLIENTIPV6=`getMyPublicIp6` - CLIENTIPV6NETPREFIXLEN=`getMyPublicIp6NetPrefixLength` - CLIENTADDRREVDOT=`getHost6DottedAddr $CLIENTIPV6 $CLIENTIPV6NETPREFIXLEN` - CLIENTARPA=`getRevnibblesArpa $CLIENTIPV6 $CLIENTIPV6NETPREFIXLEN` -} - -# server setup function -function prepareServer() { - rlRun "rhts-sync-set -s SERVERREADY" - rlRun "rhts-sync-block -s CLIENTDONE $CLIENTS" - setServerVars - showCurrentSettings - performInitialChecks - setUpNameserver - rlFileBackup "/etc/resolv.conf" - rlRun "echo -e \"nameserver $SERVERIPV6\n\" > /etc/resolv.conf" - basicSetupTest - rlRun "rhts-sync-set -s SERVERREADY" - rlRun "rhts-sync-block -s CLIENTDONE $CLIENTS" -} - -# client setup function -function prepareClient() { - rlRun "rhts-sync-block -s SERVERREADY $SERVERS" - rlRun "rhts-sync-set -s CLIENTDONE" - rlRun "rhts-sync-block -s SERVERREADY $SERVERS" - setClientVars - showCurrentSettings - performInitialChecks - rlFileBackup "/etc/resolv.conf" - rlRun "echo -e \"nameserver $SERVERIPV6\n\" > /etc/resolv.conf" - basicSetupTest - rlRun "rhts-sync-set -s CLIENTDONE" -} - -# common cleanup function -function cleanupCommon() { - rlRun "killall -9 nc" 0-255 - service named stop - rlRun "popd" - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - rlFileRestore -} - - - diff --git a/ipv6-sanity-test/ipv6calc-0.73.0.tar.gz b/ipv6-sanity-test/ipv6calc-0.73.0.tar.gz deleted file mode 100644 index 0b09769..0000000 Binary files a/ipv6-sanity-test/ipv6calc-0.73.0.tar.gz and /dev/null differ diff --git a/ipv6-sanity-test/main.fmf b/ipv6-sanity-test/main.fmf deleted file mode 100644 index 78a3846..0000000 --- a/ipv6-sanity-test/main.fmf +++ /dev/null @@ -1,11 +0,0 @@ -summary: Tests if tomcat basically work with IPv6 -description: '' -contact: Dimitris Soumis -component: - - tomcat9 -test: ./runtest.sh -framework: beakerlib -require: - - tomcat -duration: 20m - diff --git a/ipv6-sanity-test/runtest.sh b/ipv6-sanity-test/runtest.sh deleted file mode 100755 index 618a543..0000000 --- a/ipv6-sanity-test/runtest.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/tomcat/Multihost/ipv6-sanity-test -# Description: Tests if tomcat basically work with IPv6 -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -. /usr/share/beakerlib/beakerlib.sh -. ./functions.sh - -TOMCAT="tomcat" - -# set client & server manually if debugging -# SERVERS="server.example.com" -# CLIENTS="client.example.com" - -function performServer() { - rlPhaseStartTest Server - rlAssertRpm $TOMCAT - - rlRun "cp ./sample.war /var/lib/$TOMCAT/webapps" - - rlServiceStart $TOMCAT - - rlLog "$(netstat -tulpn | grep 8080)" - - rlRun "rhts-sync-set -s SERVERREADY" 0 "Server ready" - - rlRun "rhts-sync-block -s CLIENTDONE $CLIENTS" 0 "Waiting for the client" - rlPhaseEnd -} - -function performClient() { - rlPhaseStartTest Client - rlRun "rhts-sync-block -s SERVERREADY $SERVERS" 0 "Waiting for the server" - - rlRun "wget -6 -d -O - http://$SERVERS:8080/sample &> output.txt" - - rlRun "grep \"$SERVERS.*$SERVERIPV6.*8080.*connected\" output.txt" - - rlRun "rhts-sync-set -s CLIENTDONE" 0 "Client done" - rlPhaseEnd -} - -rlJournalStart - rlPhaseStartSetup - prepareCommon - rlPhaseEnd - - if echo $"SERVERS" | grep -q $"HOSTNAME" ; then - prepareServer - performServer - elif echo $"CLIENTS" | grep -q $"HOSTNAME" ; then - prepareClient - performClient - else - rlReport "Stray" "FAIL" - fi - - rlPhaseStartCleanup - cleanupCommon - rlPhaseEnd -# rlJournalPrintText -rlJournalEnd diff --git a/ipv6-sanity-test/sample.war b/ipv6-sanity-test/sample.war deleted file mode 100644 index 0a127e6..0000000 Binary files a/ipv6-sanity-test/sample.war and /dev/null differ diff --git a/libs-test/Makefile b/libs-test/Makefile deleted file mode 100644 index 5cc18b5..0000000 --- a/libs-test/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# PURPOSE of /CoreOS/tomcat/rhel9/libs-test -# Description: It checks which libraries are shipped -# Author: Matus Madzin -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/tomcat/rhel9/libs-test -export TESTVERSION=2.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 - @echo "Owner: Matus Madzin " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Check which libraries are shipped" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 20m" >> $(METADATA) - @echo "RunFor: tomcat9" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: yes" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/libs-test/main.fmf b/libs-test/main.fmf deleted file mode 100644 index 173c155..0000000 --- a/libs-test/main.fmf +++ /dev/null @@ -1,15 +0,0 @@ -summary: Check which libraries are shipped -description: '' -contact: Matus Madzin -component: - - tomcat9 -test: ./runtest.sh -framework: beakerlib -require: -- tomcat -duration: 20m -tag: -- Tier1 -tier: '1' -extra-summary: /CoreOS/tomcat/rhel9/libs-test -extra-task: /CoreOS/tomcat/rhel9/libs-test diff --git a/libs-test/runtest.sh b/libs-test/runtest.sh deleted file mode 100755 index c92ab26..0000000 --- a/libs-test/runtest.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/tomcat/rhel9/libs -# Description: It checks which libraries are shipped -# Author: Matus Madzin -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGES="${PACKAGES:-tomcat}" -REQUIRES=${REQUIRES:-} - -TOMCAT_LIB_DIR="/usr/share/tomcat/lib/" -expected_files=("annotations-api.jar" "catalina-ant.jar" "catalina-ha.jar" "catalina.jar" "catalina-ssi.jar" "catalina-storeconfig.jar" "catalina-tribes.jar" "jasper-el.jar" "jasper.jar" "jasper-jdt.jar" "jaspic-api.jar" "tomcat-api.jar" "tomcat-coyote.jar" "tomcat-dbcp.jar" "tomcat-el-3.0-api.jar" "tomcat-el-api.jar" "tomcat-i18n-cs.jar" "tomcat-i18n-de.jar" "tomcat-i18n-es.jar" "tomcat-i18n-fr.jar" "tomcat-i18n-ja.jar" "tomcat-i18n-ko.jar" "tomcat-i18n-pt-BR.jar" "tomcat-i18n-ru.jar" "tomcat-i18n-zh-CN.jar" "tomcat-jdbc.jar" "tomcat-jni.jar" "tomcat-jsp-2.3-api.jar" "tomcat-jsp-api.jar" "tomcat-juli.jar" "tomcat-servlet-4.0-api.jar" "tomcat-servlet-api.jar" "tomcat-util.jar" "tomcat-util-scan.jar" "tomcat-websocket.jar" "websocket-api.jar" "tomcat-coyote-ffm.jar") - -rlJournalStart - rlPhaseStartTest - rlRun "test -d $TOMCAT_LIB_DIR" "0" "Check if Tomcat lib dir exists" - - rlRun "pushd $TOMCAT_LIB_DIR" - rlRun "files=($( ls * ))" - rlRun "popd" - - rlRun "diff=$(echo ${expected_files[@]} ${files[@]} | tr ' ' '\n' | sort | uniq -u)" - rlRun "test -z $diff" "0" "Check if the lists are same" - rlPhaseEnd - -rlJournalEnd -rlJournalPrintText diff --git a/links-test/Makefile b/links-test/Makefile deleted file mode 100644 index a2d3431..0000000 --- a/links-test/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# PURPOSE of /CoreOS/tomcat/rhel9/links-test -# Description: It tests whether all symbolic links have target -# Author: Matus Madzin -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/tomcat/rhel9/links-test -export TESTVERSION=2.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 - @echo "Owner: Matus Madzin " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Tests whether all symbolic links have target" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 20m" >> $(METADATA) - @echo "RunFor: tomcat9" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: yes" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/links-test/main.fmf b/links-test/main.fmf deleted file mode 100644 index b8df98a..0000000 --- a/links-test/main.fmf +++ /dev/null @@ -1,15 +0,0 @@ -summary: Tests whether all symbolic links have target -description: '' -contact: Matus Madzin -component: - - tomcat9 -test: ./runtest.sh -framework: beakerlib -require: -- tomcat -duration: 20m -tag: -- Tier1 -tier: '1' -extra-summary: /CoreOS/tomcat/rhel9/links-test -extra-task: /CoreOS/tomcat/rhel9/links-test diff --git a/links-test/runtest.sh b/links-test/runtest.sh deleted file mode 100755 index cc1e279..0000000 --- a/links-test/runtest.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/tomcat/rhel9/links -# Description: It tests whether all symbolic links have target -# Author: Matus Madzin -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGES="${PACKAGES:-tomcat}" -REQUIRES=${REQUIRES:-} - -TOMCAT_LIB_DIR="/usr/share/tomcat/lib/" - -rlJournalStart - rlPhaseStartTest - rlRun "files=($( find $TOMCAT_LIB_DIR -type l ))" - - for symlink in ${files[@]}; - do - rlRun "test -e $symlink" "0" "Checking library target: $symlink" - done - - rlPhaseEnd -rlJournalEnd -rlJournalPrintText diff --git a/main.fmf b/main.fmf new file mode 100644 index 0000000..d548a2a --- /dev/null +++ b/main.fmf @@ -0,0 +1,6 @@ +contact: Dimitris Soumis +framework: beakerlib +test: ./test.sh +require: + - tomcat + - tomcat-common diff --git a/plans/all.fmf b/plans/all.fmf new file mode 100644 index 0000000..df894e9 --- /dev/null +++ b/plans/all.fmf @@ -0,0 +1,8 @@ +summary: Run all tests +discover: + how: fmf +execute: + how: tmt +provision: + how: virtual + image: fedora:rawhide \ No newline at end of file diff --git a/sanity/main.fmf b/sanity/main.fmf new file mode 100644 index 0000000..e2568b2 --- /dev/null +++ b/sanity/main.fmf @@ -0,0 +1,5 @@ +summary: Tomcat sanity test +description: Start Tomcat as a service. Check it's running and serves the ROOT app. Stop Tomcat. +require+: + - curl + - tomcat-webapps diff --git a/sanity/test.sh b/sanity/test.sh new file mode 100755 index 0000000..a4a14c8 --- /dev/null +++ b/sanity/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +CATALINA_BASE=/var/lib/tomcat + +rlJournalStart + + rlPhaseStartSetup "Pre-Test Environment Setup" + rlLog "Checking that ROOT webapp exists" + rlAssertExists ${CATALINA_BASE}/webapps/ROOT + rlLog "Starting Tomcat service" + rlServiceStart tomcat + rlPhaseEnd + + rlPhaseStartTest "Verify Tomcat Service Functionality" + rlLog "Verifying Tomcat service is active" + rlServiceStatus tomcat + # Wait until Tomcat is ready on localhost:8080 + rlLog "Waiting for Tomcat to become responsive on port 8080" + for i in {1..10}; do + if curl -s http://localhost:8080/ >/dev/null; then + rlLog "Tomcat is up after ${i} seconds" + break + else + sleep 1 + fi + done + rlLog "Checking Tomcat default page via curl" + rlRun "curl -s -w '%{http_code}' http://localhost:8080/ | grep 200" 0 "Tomcat is serving default ROOT JSP page" + rlPhaseEnd + + rlPhaseStartCleanup "Post-Test Teardown" + rlLog "Stopping Tomcat service" + rlServiceStop tomcat + rlPhaseEnd + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file diff --git a/tomcat-native/main.fmf b/tomcat-native/main.fmf new file mode 100644 index 0000000..d1ee5ef --- /dev/null +++ b/tomcat-native/main.fmf @@ -0,0 +1,2 @@ +summary: Tomcat Native test +description: Start Tomcat as a service. Check Tomcat Native is loaded. Stop Tomcat. diff --git a/tomcat-native/test.sh b/tomcat-native/test.sh new file mode 100755 index 0000000..497fcc6 --- /dev/null +++ b/tomcat-native/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + + rlPhaseStartSetup "Pre-Test Environment Setup" + rlLog "Starting Tomcat service" + rlServiceStart tomcat + rlPhaseEnd + + rlPhaseStartTest "Verify Tomcat Native loaded" + # Wait until Tomcat is ready on localhost:8080 + rlLog "Waiting for Tomcat to become responsive on port 8080" + for i in {1..10}; do + if curl -s http://localhost:8080/ >/dev/null; then + rlLog "Tomcat is up after ${i} seconds" + break + else + sleep 1 + fi + done + rlAssertGrep "Loaded Apache Tomcat Native library" /var/log/tomcat/catalina*.log + rlPhaseEnd + + rlPhaseStartCleanup "Post-Test Teardown" + rlLog "Stopping Tomcat service" + rlServiceStop tomcat + rlPhaseEnd + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file diff --git a/user-instance-check/jakartahelloworld.war b/user-instance-check/jakartahelloworld.war new file mode 100644 index 0000000..a76c951 Binary files /dev/null and b/user-instance-check/jakartahelloworld.war differ diff --git a/user-instance-check/main.fmf b/user-instance-check/main.fmf new file mode 100644 index 0000000..84edecb --- /dev/null +++ b/user-instance-check/main.fmf @@ -0,0 +1,5 @@ +summary: Tomcat user instance package check +description: Create standalone Tomcat instances with tomcat-user-instance-create. Start Tomcats. Check they are running and serve deployed apps. Stop Tomcats. +require+: + - curl + - tomcat-user-instance diff --git a/user-instance-check/test.sh b/user-instance-check/test.sh new file mode 100755 index 0000000..cbad7f5 --- /dev/null +++ b/user-instance-check/test.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + + rlPhaseStartSetup "Pre-Test Environment Setup" + rlLog "Create tomcat instances" + rlRun "tomcat-user-instance-create tomcatInstance1" 0 "Create tomcatInstance1" + rlRun "tomcat-user-instance-create -p 8081 -c 8006 tomcatInstance2" 0 "Create tomcatInstance2" + rlRun "tomcat-user-instance-create -p 8082 -c 8007 tomcatInstance3" 0 "Create tomcatInstance3" + rlLog "Deploy apps" + rlRun "cp jakartahelloworld.war tomcatInstance1/webapps" 0 "Copying sample webapp to tomcatInstance1" + rlRun "cp jakartahelloworld.war tomcatInstance2/webapps" 0 "Copying sample webapp to tomcatInstance2" + rlRun "cp jakartahelloworld.war tomcatInstance3/webapps" 0 "Copying sample webapp to tomcatInstance3" + rlLog "Start Tomcat instances" + rlRun "tomcatInstance1/bin/startup.sh" 0 "Starting tomcatInstance1" + rlRun "tomcatInstance2/bin/startup.sh" 0 "Starting tomcatInstance2" + rlRun "tomcatInstance3/bin/startup.sh" 0 "Starting tomcatInstance3" + rlPhaseEnd + + rlPhaseStartTest "Verify Tomcat instances Functionality" + sleep 10 + rlLog "Checking Tomcats via curl" + rlAssertExists tomcatInstance1/webapps/jakartahelloworld + rlAssertExists tomcatInstance2/webapps/jakartahelloworld + rlAssertExists tomcatInstance3/webapps/jakartahelloworld + rlRun "curl http://localhost:8080/jakartahelloworld/hello | grep '

Hello, World! This is a Jakarta Servlet!'" 0 "Sample servlet of tomcatInstance1" + rlRun "curl http://localhost:8081/jakartahelloworld/hello | grep '

Hello, World! This is a Jakarta Servlet!'" 0 "Sample servlet of tomcatInstance2" + rlRun "curl http://localhost:8082/jakartahelloworld/hello | grep '

Hello, World! This is a Jakarta Servlet!'" 0 "Sample servlet of tomcatInstance3" + rlPhaseEnd + + rlPhaseStartCleanup "Post-Test Teardown" + rlLog "Stopping Tomcat instances" + rlRun "tomcatInstance1/bin/shutdown.sh" 0 "Stopping tomcatInstance1" + rlRun "tomcatInstance2/bin/shutdown.sh" 0 "Stopping tomcatInstance2" + rlRun "tomcatInstance3/bin/shutdown.sh" 0 "Stopping tomcatInstance3" + rlPhaseEnd + + +rlJournalEnd +rlJournalPrintText \ No newline at end of file