Re: [Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-19 Thread HPUX_PUPPET
Thanks Johan and Martin.  I looked at the links you sent, but this is what 
I have already found and it really did not provide any new insights.  

The main problem I am having is that what I put in rspec code should be 
working but just does not. I have even hard-coded in a true or false 
return, but the spec script just does not respond.  

If anyone happens to have a good rspec language / syntax reference that 
would be greatly helpful.  The The RSpec Book gives some good examples, 
but not a language reference.   

Also I cannot seem to get any of the debug code from the net to work with 
puppet and rspec together to get some useful output to find the error. Does 
anyone have a good link to that information?  

I am just a lowly sys admin given the task to hack Puppet to get it to work 
correctly on HPUX for user management. 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9adb7d74-abc1-4041-be4e-d5d48030491d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-19 Thread Johan De Wit

On 02/19/2014 03:22 PM, HPUX_PUPPET wrote:
Thanks Johan and Martin.  I looked at the links you sent, but this is 
what I have already found and it really did not provide any new insights.


The main problem I am having is that what I put in rspec code should 
be working but just does not. I have even hard-coded in a true or 
false return, but the spec script just does not respond.


If anyone happens to have a good rspec language / syntax reference 
that would be greatly helpful.  The The RSpec Book gives some good 
examples, but not a language reference.


Also I cannot seem to get any of the debug code from the net to work 
with puppet and rspec together to get some useful output to find the 
error. Does anyone have a good link to that information?


I am just a lowly sys admin given the task to hack Puppet to get it to 
work correctly on HPUX for user management.
Don't have any experience/access to hpux,  but you can always show us 
the code and the rspec files.

So we can have at least a look at it :)

And multiple eyes see more then two :)



Next Events:
Zabbix Certified Training | 
http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | 
http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | 
http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | 
http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5304BFA7.6060702%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-19 Thread HPUX_PUPPET

On Wednesday, February 19, 2014 9:28:55 AM UTC-5, Johan De Wit wrote:

 Don't have any experience/access to hpux,  but you can always show us 
 the code and the rspec files. 
 So we can have at least a look at it :) 

 And multiple eyes see more then two :) 

  
Thanks.  I think I tracked the problem down to the source tree where I was 
working.  It seems I am missing some config flag or ENV variable to tell 
rspec to test relative the to directory where I am working and it was not 
getting the correct hpux_user.rb file, instead defaulting to the one 
installed on the box.  Now if I could just find out where to tell rspec to 
use a specific source tree, it would probably be much better :)

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/13515003-7312-49d4-bb2d-0e09a5541f6f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-18 Thread HPUX_PUPPET
Just to expand a bit more here...

I am not talking about puppet .pp files, but the back-end Ruby source 
files. I see a lot of things about puppet-lint, puppet-rspec and similar 
tools, but from the best I can tell, these are for modules and 
configuration of puppet operation and not puppet code features.  

On Tuesday, February 18, 2014 7:56:51 PM UTC-5, HPUX_PUPPET wrote:

 I am trying to get puppet to support HPUX better than it does now so it 
 can manage user accounts properly.  I have already contributed changes to 
 the HPUX module to change passwords, but writing the rspec at the time was 
 more hack and guess than any real methodology.  I did read the Learning 
 Rspec guide. It helped a small bit.  My problem is that I tried to write 
 updates to handle password expiration and found what should have worked did 
 not.

 Not coding daily the rspec drains out of my head faster that I can get it 
 back in.

 I see lots of examples out on the net, but even trying to hack around on 
 that code to try to get it work is still not doing providing valid test 
 cases.

 Can someone point me to something that will make logical sense to me as 
 well as how to actually get useful debug info when testing puppet rspec 
 files against my changes?  I have tried dozens of ways from the net, but I 
 am just not getting any trace type output to let me know what it found when 
 it did a test, what was passed to the code block or even much to help me 
 track down why it is not working. 

 I can get the Ruby code to do what I want, but cannot submit it without 
 associated rspec tests.  I would prefer to learn to do it correctly for 
 when I want to tweak more HPUX specific work and then possibly some AIX as 
 well.  I really want to get puppet in place to handle all of the non-Linux 
 boxes, but right now it is not doing it in all cases.

 It is not that rspec is that complex, it is the integration into puppet 
 and having to dig back through tons of code to try to find where everything 
 is getting fed into the hpux user modules to be able to test. If I coded 
 regularly I am sure this would be a lot easier :)  I am still trying to 
 self-teach Ruby and now add in Rspec.  

   Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/14b4061e-1371-47e5-bf7d-307cb57172a2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-18 Thread HPUX_PUPPET

Just a bit more explanation...

When I was looking for references I was only finding puppet-lint and 
rspec-puppet for testing manifests, but not finding anything for writing 
the spec files to test module functionality or modifications to existing 
modules such as the HPUX user management.  


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cf5de8e3-d6c9-490c-a497-d9fbd27a3e88%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Good resources for writing rspec tests for puppet code changes?

2014-02-18 Thread Johan De Wit

On 02/19/2014 02:03 AM, HPUX_PUPPET wrote:


Just a bit more explanation...

When I was looking for references I was only finding puppet-lint and 
rspec-puppet for testing manifests, but not finding anything for 
writing the spec files to test module functionality or modifications 
to existing modules such as the HPUX user management.



--
You received this message because you are subscribed to the Google 
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cf5de8e3-d6c9-490c-a497-d9fbd27a3e88%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

There is not that much documentation available.

I did a talk on cfgmgmtcamp.eu about TDD and puppet.  Yoiu can find a 
little blog at the BPUG website : puppet-be.github.io. (there are some 
references in the slides)


I look mostly at the puppet code for examples for writing rspec files.  
Some interesting links I also have to look at :


http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/
http://hajee.github.io/2014/01/18/testing-your-system-installation-with-rspec

https://github.com/ghoneycutt/puppet-module-nfs/blob/v1.6.2/spec/classes/init_spec.rb#L58-186

I will delve again into this topic shortly, and share my experiences in 
my sequel of the talk on puppetcamp Paris/Berlin.


Also looking for people interested in testing using rspec and there 
experience/problems


Sorry i couldn't  give you the info you need, but hope you will find 
some answers in the links.


Grts

johan






--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 


Next Events:
Zabbix Certified Training | 
http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | 
http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | 
http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | 
http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/530452B0.4040709%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.