On 03/09/2011 06:31 AM, mtaylor@redhat.com wrote:
<snip>
+++ b/spec/verify_install_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' +require 'net/ssh'
+describe "aeolus-configure install" do
- before(:each) do
- @username = "#{ENV['username']}".empty? ? "root" : "#{ENV['username']}"
- @hostname = "#{ENV['hostname']}".empty? ? "localhost" : "#{ENV['hostname']}"
- @password = "#{ENV['password']}".empty? ? nil : "#{ENV['password']}"
- end
- it "should install all aeolus packages" do
- stdout = ""
- Net::SSH.start(@hostname, @username, :password => @password) do |ssh|
ssh.exec!("rpm -qa | grep aeolus") do |channel, stream, data|
stdout<< data if stream == :stdout
end
- end
- stdout.include?("aeolus-conductor-doc").should == true
- stdout.include?("aeolus-conductor").should == true
- stdout.include?("aeolus-conductor-daemons").should == true
- stdout.include?("aeolus-configure").should == true
- end
Hey sorry for the delay, was just able to look at this. I'm wondering if this is the best way to go, eg create a ssh session in each test case and the remotely execute commands, capturing and parsing the output.
Rather it might make sense to implement the spec suite as we would normally, executing all the operations against the local system, and provide a means via our build system to copy all the tests to a remote host and execute the spec suite there via ssh/scp. Or we could create a aeolus-configure-test rpm providing the test cases which can be installed and run on a remote system.
Also organization-wise, I'm thinking we might want to break the spec suite into multiple files, one for each aeolus component, eg conductor_spec.rb, deltacloud_spec.rb, iwhd_spec.rb, etc. Each verifying the intended component has been properly setup. We can have an aeolus_spec.rb containing the integration tests which don't fit in any one module. NBD this can be easily changed at any point.
Thoughts?
-Mo