[AutoQA] #185: Hack autotest and send signals when job is finished from virt machine to host
by fedora-badges
#185: Hack autotest and send signals when job is finished from virt machine to
host
----------------------------+-----------------------------------------------
Reporter: kparal | Owner:
Type: task | Status: new
Priority: major | Milestone: Virtualization
Component: infrastructure | Version: 1.0
Keywords: |
----------------------------+-----------------------------------------------
Sometimes we need to communicate from virt machine to host (for example
after destructive test was executed). The autotest library must be hacked
and a signal (using some existing script) must be sent right after the
results were sent to autotest-server. We have to ensure that no other job
is accepted until the signal was handled.
We will probably want this hacked autotest library installed only on VM
clients, not on bare metal clients.
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/185>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
[AutoQA] #158: initscripts: samba test does not contain shebang
by fedora-badges
#158: initscripts: samba test does not contain shebang
--------------------+-------------------------------------------------------
Reporter: kparal | Owner: jskladan
Type: defect | Status: new
Priority: major | Milestone: Package update tests
Component: tests | Version: 1.0
Keywords: |
--------------------+-------------------------------------------------------
From https://fedorahosted.org/pipermail/autoqa-devel/2010-May/000523.html
{{{
> -------- Forwarded Message --------
> From: autoqa at fedoraproject.org
> Reply-to: fedora-test-list at redhat.com
> To: autoqa-results at lists.fedorahosted.org
> Subject: initscripts: 1 PASSED, 0 FAILED for package
> samba-3.4.8-59.fc12
> Date: Wed, 12 May 2010 19:59:05 -0400
>
> Following tests returned zero exit code: [('samba', 0)]
> Following tests returned NON-zero exit code: []
>
###############################################################################
> RUNNING: samba
> ==============
> posix on
> :: [20:05:54] :: [ WARNING ] :: POSIX mode detected and switched off
> :: [20:05:54] :: [ WARNING ] :: Please fix your test to have /bin/bash
> shebang
>
> ^^^
> Is this the tests/initscript/tests/samba/runtest.sh that needs
> correction?
> ^^^
I believe so.
}}}
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/158>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
[PATCH] fix list_previous_releases() to use repoinfo, and handle repos with no parents
by Will Woods
---
lib/python/koji_utils.py | 42 +++++++++++++++++++++++++++++-------------
1 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/lib/python/koji_utils.py b/lib/python/koji_utils.py
index e7c3d26..8ce7797 100644
--- a/lib/python/koji_utils.py
+++ b/lib/python/koji_utils.py
@@ -24,12 +24,6 @@ import koji
from repoinfo import repoinfo
import rpmUtils.miscutils
-parents_for_tag = {
- 'dist-f12-updates-candidate': ('f12','f12-updates','f12-updates-testing'),
- 'dist-f11-updates-candidate': ('f11','f11-updates','f11-updates-testing'),
- 'dist-f10-updates-candidate': ('f10','f10-updates','f10-updates-testing'),
-}
-
# XXX fetch from /etc/koji.conf, section 'koji'
kojiurl = 'http://koji.fedoraproject.org/kojihub'
pkgurl = 'http://koji.fedoraproject.org/packages'
@@ -112,13 +106,35 @@ class SimpleKojiClientSession(koji.ClientSession):
max_evr = (epoch, version, release)
'''
prev_rlss = {}
- for p in parents_for_tag[tag]:
- ptag = repoinfo.get(p,'tag')
- if ('-testing' in ptag or '-candidate' in ptag) and \
- not unstable_tags:
- # skip unstable tags
- continue
- prev_rlss[ptag] = self.latest_by_tag(ptag, name, max_evr=max_evr)
+ # minor hack - assume -candidate parents = stable+updates+testing
+ # TODO: provide this info in repoinfo instead
+ if tag.endswith('-updates-candidate'):
+ testtag = tag.replace('-candidate','-testing')
+ testrepo = repoinfo.getrepo_by_tag(testtag)
+ # -testing parents = stable+updates. add -testing and we're good.
+ parents = testrepo['parents'] + [testrepo['name']]
+ else:
+ parents = repoinfo.getrepo_by_tag(tag)['parents']
+ if parents:
+ for p in parents:
+ ptag = repoinfo.get(p,'tag')
+ if ('-testing' in ptag or '-candidate' in ptag) and \
+ not unstable_tags:
+ # skip unstable tags
+ continue
+ prev_rlss[ptag] = self.latest_by_tag(ptag, name, max_evr=max_evr)
+ else:
+ # NOTE: for tags with no parents (e.g. rawhide) we obviously can't
+ # check the parent repos' tags to get the previously released
+ # package NVRs. Instead we use koji's tagHistory command to find
+ # the previous version of this package that had this tag.
+ hist = self.tagHistory(tag=tag, package=name)
+ # remove untagged builds
+ hist = filter(lambda h: h['revoke_event'] is None, hist)
+ # ensure sorting by time
+ hist.sort(key=lambda h: h['create_ts'])
+ # hist[-2] = not the currently-tagged build, the one before that
+ prev_rlss[tag] = self.getBuild(hist[-2]['build_id'])
return prev_rlss
def list_previous_release(self, name, tag, max_evr=None,
--
1.7.0.1
13 years, 3 months
using virt systems for destructive tests
by Kamil Paral
Hello,
for some time I studied the possibilities of using virt
systems for our tests. It should be usable mainly for
destructive tests (<insert emphasis here>). The first
candidate of such tests is Package Sanity Test, which
is not exactly destructive, but we would really prefer
to run it on some disposable system :) But it's not just
for this test, we will need it generally for many future
tests. So we should take it more like "another feature
of AutoQA" rather than "special requirement of PST".
And it's not gonna be too easy (surprise, surprise).
I have thought about several ways how to use virtualization
for our needs, unfortunately in every scenario there is
some large problem lurking. I'll post just a quick
summary of two most obvious ones (mentioned by jlaska
some time ago [1]). I had some more, but they didn't
even survived the competition. So:
Scenario #1:
We install autotest-client directly to VMs. The problem
is that for destructive tests we need to inform the
host *in advance* to create VM harddisk snapshot, then
accept and execute the test, and then revert VM state
back to original. Informing host in advance to accepting
test seems really hard to solve.
Scenario #2:
We hack autotest and create test class that will do
all the necessary stuff in setup()/teardown() methods
(creating disk snapshot/reverting back). Then required
tests just inherit from this special test class,
everything else is transparent.
The problem is how to transfer the core part of the
test (without those setup/teardown methods) into
the VM, execute it, and receive the result back. We
would probably have to create some kind of autotest
relay client, that would pretend to be the client for
our real autotest-server, but it would act as a
server for the client in the virtual machine. Some kind
of mediator. Not nice.
--------
Well, fortunately I have consulted this with jskladan
and he had this brilliant idea (send kudos and salary
increases to him):
Scenario #3:
We install autotest-client directly to VM. But here's
an important part - the VM always runs on a disposable
disk snapshot. If destructive test arrives, there's
no need to adjust anything. After destructive test
completes, here's the twist: We will have hacked the
autotest method for sending results. Not only it sends
results, but it also sends a signal to the host machine.
This signal would be "job completed, revert me". The
host reverts the VM into an original state and puts
it on disposable disk snapshot again. Everything comes
full circle.
Here's an illustration of the principle, bear with my
graphics skills:
|
|1.job
| .-------------------------.
v | Host |
.----------. | ^ |
| Autotest | | |4.signal |
| server |^ | | |
'----------'| 3.result | .----------------. |
| '-------------| Autotest | |
'------------------>| client | |
2.job | | (virt machine) | |
| '----------------' |
'-------------------------'
Of course there are some assumptions:
1. We must tweak the method for sending results in
autotest-client and install it on VMs.
2. We must ensure no other job is accepted in VM
between sending results and reverting the VM.
3. We must write a script for sending the signal
and a daemon for receiving the signal and acting
accordingly.
4. We must use special tags in autotest to distinguish
hosts suitable for destructive tests and hosts not
suitable for it.
5. We must write a script take will run on the Host
and perform maintenance of VMs periodically (like
fully updating them, etc).
But all of these seem to me (at least currently) like
pretty minor tasks compared to problems with the first
two proposed scenarios. And this is the least "hackish"
approach.
So, what do you think? Any concerns, suggestions?
Is everything understandable, or have I described some
parts poorly?
I think this task calls for its own milestone, as I
see it. But the implementation could be entertaining :)
[1] https://fedorahosted.org/autoqa/ticket/128#comment:4
13 years, 3 months
[PATCH] Cleanup avahi/runtest.sh according to initscript test guidelines (ticket#162)
by James Laska
* Corrected path for beakerlib.vim syntax hilight
* Seperate tests using rlPhase instead of rlLog
* PIDFILE creation/cleanup is handled by the daemon, so modify the PIDFILE and LOCKFILE tests to consider this
---
tests/initscripts/tests/avahi/runtest.sh | 59 +++++++++++++++---------------
1 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/tests/initscripts/tests/avahi/runtest.sh b/tests/initscripts/tests/avahi/runtest.sh
index 00769d7..ccca252 100755
--- a/tests/initscripts/tests/avahi/runtest.sh
+++ b/tests/initscripts/tests/avahi/runtest.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/avahi/Sanity/initscript
@@ -35,7 +35,6 @@ PACKAGE="avahi"
rlJournalStart
rlPhaseStartSetup
- rlAssertRpm $PACKAGE
rlAssertRpm "avahi"
rlAssertRpm "avahi-dnsconfd"
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
@@ -52,55 +51,55 @@ rlJournalStart
for ACTION in "start" "stop" "restart" "force-reload" "status" ; do
rlRun "grep -i \"usage.*$ACTION\" /etc/init.d/$SERVICE"
done
+ rlPhaseEnd
+ rlPhaseStartTest "$SERVICE - start"
if [ $SERVICE == "avahi-dnsconfd" ] ; then
rlServiceStart avahi-daemon
fi
- rlLog ">>>>>>>>> service start"
rlRun "service $SERVICE start" 0 " Service must start without problem"
rlRun "service $SERVICE status" 0 " Then Status command "
rlRun "service $SERVICE start" 0 " Already started service "
rlRun "service $SERVICE status" 0 " Again status command "
+ rlPhaseEnd
- rlLog ">>>>>>>>> service restart"
+ rlPhaseStartTest "$SERVICE - restart"
rlRun "service $SERVICE restart" 0 " Restarting of service"
rlRun "service $SERVICE status" 0 " Status command "
+ rlPhaseEnd
- rlLog ">>>>>>>>> service stop"
+ rlPhaseStartTest "$SERVICE - stop"
rlRun "service $SERVICE stop" 0 " Stopping service "
rlRun "service $SERVICE status" 3 " Status of stopped service "
rlRun "service $SERVICE stop" 0 " Stopping service again "
rlRun "service $SERVICE status" 3 " Status of stopped service "
+ rlPhaseEnd
-
- rlLog ">>>>>>>>> pid file"
- rlServiceStart $SERVICE
-
+ rlPhaseStartTest "$SERVICE - pid"
if [ $SERVICE == "avahi-daemon" ] ; then
PID_FILE="/var/run/avahi-daemon/pid"
- rlAssertExists "$PID_FILE" "$PID_FILE must exist"
- rlRun "killall $SERVICE" 0 "Kill $SERVICE"
- fi
- if [ $SERVICE == "avahi-dnsconfd" ] ; then
+ elif [ $SERVICE == "avahi-dnsconfd" ] ; then
PID_FILE="/var/run/avahi-dnsconfd.pid"
- rlAssertExists "$PID_FILE" "$PID_FILE must exist"
- rlRun "kill -9 `pidof $SERVICE`" 0 "Kill $SERVICE"
fi
-
+ rlRun "touch $PID_FILE"
rlRun "service $SERVICE status" 1 " Existing pid file, but service not started "
rlRun "rm -fv $PID_FILE" 0 "Remove .pid file"
-
- rlLog ">>>>>>>>> lock file"
- rlAssertExists "/var/lock/subsys/$SERVICE" "Lock file /var/lock/subsys/$SERVICE must exist"
+ rlPhaseEnd
+
+ rlPhaseStartTest "$SERVICE - lock"
+ LOCK_FILE="/var/lock/subsys/$SERVICE"
+ rlRun "touch $LOCK_FILE"
rlRun "service $SERVICE status" 2 " Existing lock file, but service not started "
- rlServiceStop $SERVICE
+ rlRun "rm -fv $LOCK_FILE" 0 "Remove lock file"
+ rlPhaseEnd
- rlLog ">>>>>>>>> insufficient rights"
+ rlPhaseStartTest "$SERVICE - insufficient rights"
rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user "
- rlRun "su testuserqa -c 'service $SERVICE restart'" 4 "Insufficient rights, restarting service under nonprivileged user must fail"
-
- rlLog ">>>>>>>>> operations"
+ rlRun "su testuserqa -c 'service $SERVICE restart'" 1,4 "Insufficient rights, restarting service under nonprivileged user must fail"
+ rlPhaseEnd
+
+ rlPhaseStartTest "$SERVICE - operations"
rlRun "service $SERVICE start" 0 " Service have to implement start function "
rlRun "service $SERVICE restart" 0 " Service have to implement restart function "
rlRun "service $SERVICE status" 0 " Service have to implement status function "
@@ -108,17 +107,17 @@ rlJournalStart
rlRun "service $SERVICE try-restart" 0 " Service have to implement try-restart function "
rlRun "service $SERVICE reload" 0 " Service have to implement reload function "
rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function "
-
- rlLog ">>>>>>>>> nonexist operations"
+ rlPhaseEnd
+
+ rlPhaseStartTest "$SERVICE - invalid operation"
rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function"
+ rlPhaseEnd
- rlLog ">>>>>>>>> invalid arguments"
+ rlPhaseStartTest "$SERVICE - invalid argument"
rlRun "service $SERVICE" 2 " When no arguments added to service, it must fail with proper return code "
- rlPhaseEnd
-
rlPhaseEnd
- rlPhaseStartCleanup "Restore service"
+ rlPhaseStartCleanup "$SERVICE - Restore service"
rlServiceRestore $SERVICE
rlPhaseEnd
done
--
1.7.0.1
13 years, 3 months
[PATCH] Cleanup autofs/runtest.sh according to initscript test guidelines (ticket#161)
by James Laska
* Corrected pidfile path (dependent on bug#600336)
* Removed duplicate PID test
* Fixed typo in condrestart test
* Add additional status checks at the end of both the LOCKFILE and PIDFILE tests
---
tests/initscripts/tests/autofs/runtest.sh | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/tests/initscripts/tests/autofs/runtest.sh b/tests/initscripts/tests/autofs/runtest.sh
index db38b96..e11d484 100755
--- a/tests/initscripts/tests/autofs/runtest.sh
+++ b/tests/initscripts/tests/autofs/runtest.sh
@@ -33,6 +33,8 @@
PACKAGE="autofs"
SERVICE="autofs"
+LOCKFILE="/var/lock/subsys/automount"
+PIDFILE="/var/run/$SERVICE.pid"
rlJournalStart
rlPhaseStartSetup
@@ -42,7 +44,8 @@ rlJournalStart
rlServiceStop $SERVICE
rlPhaseEnd
rlPhaseStartTest "Mandatory actions"
- for ACTION in "start" "stop" "restart" "force-reload" "status" ; do
+ #for ACTION in "start" "stop" "restart" "force-reload" "status" ; do
+ for ACTION in "start" "stop" "restart" "condrestart" "reload" "force-reload" "status" "usage"; do
rlRun "grep -i \"usage.*$ACTION\" /etc/init.d/$SERVICE"
done
rlPhaseEnd
@@ -61,26 +64,30 @@ rlJournalStart
rlRun "service $SERVICE status" 3
rlPhaseEnd
rlPhaseStartTest "Lock file"
- rlRun "touch /var/lock/subsys/$SERVICE"
+ rlRun "touch $LOCKFILE"
rlRun "service $SERVICE status" 2
+ rlRun "rm -rf $LOCKFILE"
+ rlRun "service $SERVICE status" 3
rlPhaseEnd
rlPhaseStartTest "PID file"
- rlRun "touch /var/run/$SERVICE.pid"
+ rlRun "touch $PIDFILE"
rlRun "service $SERVICE status" 1
- rlRun "rm -rf /var/run/$SERVICE.pid"
+ rlRun "rm -rf $PIDFILE"
+ rlRun "service $SERVICE status" 3
rlPhaseEnd
rlPhaseStartTest "Condrestart"
+ service $SERVICE restart
service $SERVICE | grep "condrestart" && COND="1" || COND="0"
- if [ "$COND" -eq "1"]; then
+ if [ "$COND" -eq "1" ]; then
rlRun "service $SERVICE condrestart" 0
rlRun "service $SERVICE status" 0
else
- rm -f /var/lock/subsys/$SERVICE
+ rm -f $LOCKFILE
fi
service $SERVICE stop
rlPhaseEnd
rlPhaseStartTest "Invalid arguments"
- rlRun "service $SERVICE" 2
+ rlRun "service $SERVICE" 1,2
rlPhaseEnd
rlPhaseStartTest "Recognized actions"
@@ -94,10 +101,6 @@ rlJournalStart
rm -f $USAGE_FILE
rm -f $CASE_FILE
rlPhaseEnd
- rlPhaseStartTest "PID file"
- rlRun "touch /var/run/$SERVICE.pid"
- rlRun "service $SERVICE status" 1
- rlPhaseEnd
rlPhaseStartCleanup
rlServiceRestore $SERVICE
--
1.7.0.1
13 years, 3 months