[Ovirt-devel] [PATCH server] Fixed the tests for host-browser.

Mohammed Morsi mmorsi at redhat.com
Thu Oct 2 18:02:50 UTC 2008


Darryl,

I haven't tried the latest patch that you sent yet, but noticed a few
things while doing some further testing.


Darryl Pierce wrote:
> Mohammed Morsi wrote:
>   
>>>  BuildRequires: ruby-devel
>>> +BuildRequires: ruby-flexmock
>>>  BuildRequires: ruby-gettext-package
>>>  BuildRequires: rubygem(rake) >= 0.7
>>>  Provides: ovirt-server
>>>   
>>>       
>> git-am reported some conflict with this file when I applied the patch.
>> Luckily this file contained a simple one line change so I was able to
>> manually copy it over and remove the file from the patch.
>>     
>
> Weird. I only added the ruby-flexmock dependency since it's come up a
> few times.
>   
First off, shouldn't this just be a 'Requires'? I think BuildRequires
implies that this needs to be on the machine hosting the appliance when
the rpms are being build where as 'Requires' implies it needs to be on
the appliance for this rpm to be installed which is what we want (since
its on the appliance that 'rake test' requires ruby-flexmock).

>   
>>> diff --git a/src/test/unit/host_browser_awaken_test.rb b/src/test/unit/host_browser_awaken_test.rb
>>> index 5340e01..55a3458 100644
>>> --- a/src/test/unit/host_browser_awaken_test.rb
>>> +++ b/src/test/unit/host_browser_awaken_test.rb
>>> @@ -64,7 +64,7 @@ class HostBrowserAwakenTest < Test::Unit::TestCase
>>>    # Ensures that the server is satisfied if the remote system is
>>>    # making a wakeup call.
>>>    #
>>> -  def test_get_mode_with_awaken_request
>>> +  def test_get_mode_with_awaken_request    
>>>   
>>>       
>> Same issue with trailing whitespace here.
>>     
>
> I made sure to remove trailing whitespaces in these files since they'd
> creeped in previously.
>
>   
>>     
>>>      @session.should_receive(:write).with("MODE?\n").once().returns { |request| request.length }
>>>      @session.should_receive(:readline).once().returns { "AWAKEN\n" }
>>>  
>>>   
>>>       
>> After applying the patch, I tried running the test cases but to no
>> avail, many were still broken. 
>>     
>
> This patch was only to fix the HostBrowser tests, none others; such bugs
> as the one to do with @first_id are outside of its scope. The tests that
> I fixed with this run without error.
>
>   
I see here
http://git.et.redhat.com/?p=ovirt-server.git;a=commitdiff;h=0453e0e65bb0232acadbe3bf0e59cabf0df2f3f0
that you removed where @first_id is set in the nic_controller_test. I
was able to get all the tests running successfully (see below) except
for test_show in the nic_controller_test which depends on @first_id
being set (and thus reports an "Couldn't find Nic without an ID" error).


> I'm sending an updated patch now.
>
>   

I discovered the reason everything was foobar was that the pools table
wasn't being populated in the ovirt_test database. This was caused by an
error earlier in the test process which in return caused 'rake test' to
abort and skip over the remaining test db population stuff. The error
was a path issue, eg test/unit/host_browser_identify_test.rb was unable
to find dutils.rb and host_browser.rb. Adding the following to
host_browser_identify_test.rb solves the problem:

$: << File.join(File.dirname(__FILE__), "../../dutils")
$: << File.join(File.dirname(__FILE__), "../../host-browser")

As previously mentioned, once this is done the only remaining error is
that due to the missing nic id. If we can get these fixes in today and
everything works, I'll uncomment the 'rake test' thats in the appliance
autobuild so that our continuous autobuild process will report any new
errors caused by subsequent changes immediately.

   -Mo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20081002/bf1be5cb/attachment.htm>


More information about the ovirt-devel mailing list