Re: [Spacewalk-devel] XML-RPC tests

2011-04-28 Thread Jan Hutař
> Hi,
> 
>  you may remember the last post I sent in January where I
> proposed the way of how tests for XML-RPC will be organized.
> Well, things changed and since I am going to finish my bachelor
> thesis I would like to present you the result.
> 
>  After a lot of discussions with my supervisors and hours of
> work I have managed to connect the code coverage tools. The
> reason why there is code coverage is that documentation for both
> APIs does not exist. Frontend API comes just with specification
> of all calls, but it does not mention any behavior. The test
> requirements therefore come from the source code.
> 
>  The "project" consists of two modules -- the tests module and
> coverage module.
> 
>  The tests module contains BeakerLib-based tests. There is also
> a BeakerLib plugin which utilizes common actions. These tests
> basically call some XML-RPC procedure, assert the results, and
> check whether there was an addition to the server log (httpd's
> error_log or tomcat's catalina.out based on type of tested API
> -- frontend/backend). This module works standalone and does not
> depend on anything from coverage module.
> 
>  The coverage module extends the tests module by measuring the
> code coverage (branch coverage, actually). It does need to be
> installed and handled by a superuser. Installation instruments
> the rhn.jar using Cobertura and updates the mod_wsgi/mod_python
> configuration to use different handlers. These handlers just
> start and stop the collecting of coverage data using coverage.py
> and wrap the real handlers. After installation it is possible to
> see which parts of code was executed using bundled scripts.
> There might be a problem with superuser privileges (Cobertura
> flushes the coverage data into file only on tomcat's shutdown
> and therefore the tomcat must be restarted before evaluation of
> coverage can start) but since it is reasonable to use it only
> against development installation, it should not be a problem to
> run few scripts as a superuser.
> 
>  The example of output (just tests module with one failing test
> out of two):
> 
> tests-module$ ./runtests.sh
>  FAIL of /auth/login: See /tmp/beakerlib-XR30U3q/journal.txt
>  Passed 1 out of 2 tests
> 
> The example of output (the coverage module calling the same
> tests as above):
> 
> coverage-module$ sudo ./runtests.sh 
>  Coverage data file were successfully reset
>  FAIL of /auth/login: See /tmp/beakerlib-eFh18KQ/journal.txt
>  Passed 1 out of 2 tests
>  Branch coverage: Java 1%, Python 3%
> 
>  If you are interested in the HTML coverage reports, see these:
> Coverage.py HTML report (~ 1.5 MB):
> http://vlki.cz/python_html_report.tar.gz Cobertura HTML report
> (~ 5 MB): http://vlki.cz/java_html_report.tar.gz Everything was
> tested using Spacewalk 1.2/Fedora 14.
> 
>  Well... Do you like it? Do you find it useful?
> 
>  Thanks for your thoughts,
>  Jan

Hello Jan.
We had a discussion here and to summarise thoughts this would be
nice:

1) Demonstrate benefit of your work to developers and testers of
a Spacewalk project - would it be possible to show step by step,
what would happen in this scenario:
 * developer adds new API call
 * tester notifies coverage percentage goes down
 * tester adds new test
 * coverage percentage gets fixed
Would it be possible to have this demonstrated with some simple
example by adding some simple API call and then testing it?

2) I know you plan to show how percentage is rising when you are
adding more tests. That is nice as well. But for actual project
community, above point is important as well.

3) Could you please post tests you have used to exercise code
parts shown above?

4) You also might want to demonstrate, how your tool can help in
a situation like:
 * tester believes he created test testing call X completely
 * then you comes and says: look, using your test you are
   testing only one of multiple possible code paths
 * (imagine some function with some "if system_is_virtual_guest"
   at the beginning being tested only from physical client)

This should be majority of what I wanted to say. Anyway, I do
like what you have done a lot.

Thanks for a great work on this,
Jan



-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.


pgpzxLiKWGhBq.pgp
Description: PGP signature
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] YUM RHN Lock Plugin

2012-06-13 Thread Jan Hutař
On Thu, 7 Jun 2012 18:32:06 -0400 "Musayev, Ilya"
 wrote:

> While RHN has a limitation on locking the host from the Web
> UI, user is still able to run yum operations from the host
> (granted user has proper access).
> 
> I wrote a simple YUM plugin to check if the host is locked in
> RHN and if it is, prevent yum usage on the host.
> 
> Needless to say, this is proof of concept and my python skills
> are lacking, nevertheless it works.
> 
> TODO:
> * Move Authentication part into config - easy to do but not
> secure
> * Use alternative method of authentication used by rhnplugin -
> need to see how that can be done - if it all possible
> 
> I need help with understanding how i can leverage rhnplugin
> type of auth with RHN Lock Yum Plugin.
> 
> The proof of concept code is below - if you could make any
> suggestions and improvements - it would be appreciated.
> 
> 
> Thanks
> ilya
> 
> 
> 
> --- /etc/yum/pluginconf.d/rhnlockplugin.conf 
> [main]
> enabled=1
> 
> 
> 
> -- /usr/share/yum-plugins/rhnlockplugin.py --
> 
> from yum.plugins import PluginYumExit, TYPE_CORE,
> TYPE_INTERACTIVE from xml.dom import minidom
> import xmlrpclib
> 
> requires_api_version = '2.3'
> plugin_type = (TYPE_CORE, TYPE_INTERACTIVE)
> 
> def init_hook(conduit):
> conduit.info(2, 'Checking if system is locked in
> RHN/Spacewalk') SATELLITE_URL =
> "http://spacewalk.hostname.com/rpc/api"; SATELLITE_LOGIN =
> "admin" SATELLITE_PASSWORD = "password"
> 
> client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
> 
> key = client.auth.login(SATELLITE_LOGIN,
> SATELLITE_PASSWORD)
> 
> #--
> def getSystemID(xml):
> """
> Print out all names found in xml
> """
> doc = minidom.parse(xml)
> node = doc.documentElement
> members = doc.getElementsByTagName("member")
> 
> for member in members:
> name = member.getElementsByTagName("name")
> [0].firstChild.data if name == "system_id":
> value = \
> member.getElementsByTagName("string")
> [0].firstChild.data return value.replace("ID-","")
> 
> def getLockStatus(sysID):
> """
> Function to check if the host is locked
> """
> details = client.system.getDetails(key, int(sysID))
> if details['lock_status']:
> #print "ERROR: Skipping RHN/Spacewalk locked
> #system %s" % sysID
> raise PluginYumExit('ERROR: Skipping RHN/Spacewalk
> locked system: %s' % sysID) else:
> print "NOTE: This host in not locked in
> RHN/Spacewalk"
> 
> systemIDfile = '/etc/sysconfig/rhn/systemid'
> mySystemID = getSystemID(systemIDfile)
> getLockStatus(getSystemID(systemIDfile))
> 
> client.auth.logout(key)
> ---

Hello,
not sure what you want to achieve here, but note you can do `yum
--noplugins ...` which would just disable the plugin and allow
normal yum operation.

Regards,
Jan



-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.


pgpbpG0Ej6Xyi.pgp
Description: PGP signature
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] YUM RHN Lock Plugin

2012-06-14 Thread Jan Hutař
On Wed, 13 Jun 2012 08:49:46 -0400 "Musayev, Ilya"
 wrote:

> That is correct. You can also install via RPM. If I'm not
> mistaken, --noplugings will also cut off rhn-plugin and
> therefore there will be no rhn repos. 
> 
> Ideally, it would be nice to integrate RHN LOCK with
> rhn-yum-plugin. That way if system locked - it is truly locked
> from both aspects (GUI and CLI) and you would not be able to
> disable lock independently. 

Hello,
of course, yum have "--disableplugin=[plugin]" as well. What I
wanted to say is: that plugin might be creating some false
feeling of something being disabled/secured. If it is meant more
"do not incidentally install packages on locked system", then it
is OK.

Regards,
Jan



> On Jun 13, 2012, at 6:43 AM, "Jan Hutař" 
> wrote:
> 
> > On Thu, 7 Jun 2012 18:32:06 -0400 "Musayev, Ilya"
> >  wrote:
> > 
> >> While RHN has a limitation on locking the host from the Web
> >> UI, user is still able to run yum operations from the host
> >> (granted user has proper access).
> >> 
> >> I wrote a simple YUM plugin to check if the host is locked
> >> in RHN and if it is, prevent yum usage on the host.
> >> 
> >> Needless to say, this is proof of concept and my python
> >> skills are lacking, nevertheless it works.
> >> 
> >> TODO:
> >> * Move Authentication part into config - easy to do but not
> >> secure
> >> * Use alternative method of authentication used by
> >> rhnplugin - need to see how that can be done - if it all
> >> possible
> >> 
> >> I need help with understanding how i can leverage rhnplugin
> >> type of auth with RHN Lock Yum Plugin.
> >> 
> >> The proof of concept code is below - if you could make any
> >> suggestions and improvements - it would be appreciated.
> >> 
> >> 
> >> Thanks
> >> ilya
> >> 
> >> 
> >> 
> >> --- /etc/yum/pluginconf.d/rhnlockplugin.conf
> >>  [main]
> >> enabled=1
> >> 
> >> 
> >> 
> >> -- /usr/share/yum-plugins/rhnlockplugin.py
> >> --
> >> 
> >> from yum.plugins import PluginYumExit, TYPE_CORE,
> >> TYPE_INTERACTIVE from xml.dom import minidom
> >> import xmlrpclib
> >> 
> >> requires_api_version = '2.3'
> >> plugin_type = (TYPE_CORE, TYPE_INTERACTIVE)
> >> 
> >> def init_hook(conduit):
> >>conduit.info(2, 'Checking if system is locked in
> >> RHN/Spacewalk') SATELLITE_URL =
> >> "http://spacewalk.hostname.com/rpc/api"; SATELLITE_LOGIN =
> >> "admin" SATELLITE_PASSWORD = "password"
> >> 
> >>client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
> >> 
> >>key = client.auth.login(SATELLITE_LOGIN,
> >> SATELLITE_PASSWORD)
> >> 
> >>#--
> >>def getSystemID(xml):
> >>"""
> >>Print out all names found in xml
> >>"""
> >>doc = minidom.parse(xml)
> >>node = doc.documentElement
> >>members = doc.getElementsByTagName("member")
> >> 
> >>for member in members:
> >>name = member.getElementsByTagName("name")
> >> [0].firstChild.data if name == "system_id":
> >>value = \
> >>member.getElementsByTagName("string")
> >> [0].firstChild.data return value.replace("ID-","")
> >> 
> >>def getLockStatus(sysID):
> >>"""
> >>Function to check if the host is locked
> >>"""
> >>details = client.system.getDetails(key, int(sysID))
> >>if details['lock_status']:
> >>#print "ERROR: Skipping RHN/Spacewalk locked
> >>#system %s" % sysID
> >>raise PluginYumExit('ERROR: Skipping
> >> RHN/Spacewalk locked system: %s' % sysID) else:
> >>print "NOTE: This host in not locked in
> >> RHN/Spacewalk"
> >> 
> >>systemIDfile = '/etc/sysconfig/rhn/systemid'
> >>mySystemID = getSystemID(systemIDfile)
> >>getLockStatus(getSystemID(systemIDfile))
> >> 
> >>client.auth.logout(key)
> >> ---
> > 
> > Hello,
> > not sure what you want to achieve here, but note you can do
> > `yum
> > --noplugins ...` which would just disable the plugin and
> > allow normal yum operation.
> > 
> > Regards,
> > Jan
> > 
> > 
> > 
> > -- 
> > Jan Hutar Systems Management QA
> > jhu...@redhat.com Red Hat, Inc.


-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.


pgpth5xxzcMun.pgp
Description: PGP signature
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] fixing typo "a general socket occurred" -> "a general socket exception occurred"

2013-01-08 Thread Jan Hutař
Hello,
just seen this strange error in satellite-sync but I'm currently
unable to commit into git myself. Could somebody please commit
if it seems reasonable to you?

Thank you in advance,
Jan



-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.


general_socket_exception.patch
Description: Binary data


pgpsT2nZiYNPQ.pgp
Description: PGP signature
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] rhel errata xml file

2016-02-10 Thread Jan Hutař
On Thu, 4 Feb 2016 16:40:16 + Chris Fumai
 wrote:

> Hi,
> 
> Can someone tell me the location of the official RHEL errata
> xml file so I can upload the errata to my spacewalk server ?
> 
> I am using Steve Meier's errata import perl script for this
> process

Hello,
I do not know this tool, but to sync RHEL erratas, you would
usually use satellite-sync tool (that is normally used by
subscribed and activated Satellite server).

Regards,
Jan



> Thanks
> 
> 
> Chris Fumai | Vice President | AQR Capital Management  | 1
> Greenwich Plaza, 2nd Floor, Greenwich, CT 06830 |
> 203-742-3722  | chris.fu...@aqr.com
> 
> 
> 
> 
> Disclaimer: This e-mail may contain confidential and/or
> privileged information. If you are not the intended recipient
> or have received this e-mail in error, please notify the
> sender immediately and destroy/delete this e-mail. You are
> hereby notified that any unauthorized copying, disclosure or
> distribution of the material in this e-mail is strictly
> prohibited.
> 
> This communication is for informational purposes only. It is
> not intended as an offer or solicitation for the purchase or
> sale of any financial instrument or as an official
> confirmation of any transaction. All information contained in
> this communication is not warranted as to completeness or
> accuracy and is subject to change without notice. Any comments
> or statements made in this communication do not necessarily
> reflect those of AQR Capital Management, LLC and its
> affiliates.


-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] Centos/RHEL 5 Client repository

2016-02-10 Thread Jan Hutař
On Thu, 15 Oct 2015 10:10:12 +0200 Graziano Della Loggia
 wrote:

> Hi,
> I want to notice that the packages
> 
> http://yum.spacewalkproject.org/2.4-client/RHEL/5/x86_64/spacewalk-client-repo-2.3-2.el5.noarch.rpm
> http://yum.spacewalkproject.org/2.4-client/RHEL/5/i386/spacewalk-client-repo-2.3-2.el5.noarch.rpm
> 
> contains a repository link error:
> 
> baseurl=http://yum.spacewalkproject.org/2.3-client/RHEL/5/$basearch/
> gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2014
> 
> so after the upgrade the client repo rpm upgrade, there are
> not upgradable client packages.
> Instead with manual modification to
> 
> baseurl=http://yum.spacewalkproject.org/2.4-client/RHEL/5/$basearch/
> gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2015
> 
> the packages upgradable to are:
> 
> rhnlib-2.5.75-1.el5.noarch
> rhn-client-tools-2.3.16-1.el5.noarch
> rhn-check-2.3.16-1.el5.noarch
> yum-rhn-plugin-2.3.3-1.el5.noarch
> spacewalk-oscap-2.3.1-1.el5.noarch

Hello.

Just for a record, this was fixed 15-Oct-2015:

  
http://yum.spacewalkproject.org/2.4-client/RHEL/5/x86_64/spacewalk-client-repo-2.4-3.el5.noarch.rpm

> Thanks for good job,
> 
> Graziano

Regards,
Jan



-- 
Jan Hutar Systems Management QA
jhu...@redhat.com Red Hat, Inc.

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel