Hi Matt,
Sorry for not being clearer...
On 29/08/2011 11:52, Matt Keenan wrote:
>
> Hey Darren,
>
> thanks for the review, but not 100% sure what you mean here.
>
> On 08/29/11 10:56, Darren Kenny wrote:
>> Hi Matt,
>>
>> I'm not sure about the location if the check_init_SMF() call... I would
>> expect
>> that this is only run when you call the python module directly, but not if
>> done
>> via NOSE.
>>
> Do you mean the location of the method definition or when it's actually
> called ?
I mean when it's called.
> It should really be called regardless of whether running Nose or not,
> the tests that call
> check_install_SMF() will fail if the service is not there, and this is
> regardless of whether
> being run directly (manually) or via nose.
Ok, but in the way you have the code in test_aimdns_manual.py, you have the only
call to the method within a clause like:
248 if __name__ == '__main__':
249 # Ensure system/install/server SMF service is available
250 check_install_SMF()
251
252 gettext.install("ai", "/usr/lib/locale")
253 unittest.main()
Any thing inside of this clause is only ever run if you call the code directly
as:
python test_aimdns_manual.py
It will not be run if you call it via the NOSE test harness, which will import
it, and as such the module name (__name__) will not be '__main__'.
>
>> As such it would seem wrong to be throwing a NOSE specific exception when not
>> running NOSE...
>>
>
> Fair point, i suppose. what do you suggest, just exiting without raising
> anything ?
No, it's probably fine to raise it, I'm just trying to say that it will never be
raised within NOSE as coded.
>
>> Maybe it should be called outside of the 'if' statement, that way it will
>> always
>> be executed.
>>
>
> Outside of what if statement ? what source file are you referring to here.
See above.
Hope this is clearer.
Thanks,
Darren.
>
> cheers
>
> Matt
>
>> Thanks,
>>
>> Darren.
>>
>> On 26/08/2011 18:13, Matt Keenan wrote:
>>> Hi,
>>>
>>> Re-Worked webrev now posted to ;
>>> https://cr.opensolaris.org/action/browse/caiman/mattman/7050547/
>>>
>>> This webrev contains :
>>>
>>> - Splitting out tests that require 120 second timeouts to be manual
>>> tests, and leaving
>>> all other tests intact.
>>>
>>> - Calling check_install_SMF() at init time where it makes sense.
>>>
>>> cheers
>>>
>>> Matt
>>>
>>> On 08/26/11 14:09, Matt Keenan wrote:
>>>> Hi,
>>>>
>>>> Can I get a review and blessing for fix for :
>>>> 7050547 ai_sd/aimdns unit tests failing on machine not configured
>>>> as AI server
>>>> http://monaco.sfbay.sun.com/detail.jsf?cr=7050547
>>>>
>>>> Webrev:
>>>> https://cr.opensolaris.org/action/browse/caiman/mattman/7050547/
>>>>
>>>>
>>>> Slim install unit tests tend to be run on a build machine which is not
>>>> configured as an install server, thus these tests fail. Nose provides
>>>> a SkipTest exception which when used will not report the tests
>>>> themselves as failed.
>>>>
>>>> For ai_sd if multicast DNS SMF is not available then the tests will fail.
>>>>
>>>> For aimdns if install/server SMF is not available 5 tests will fail.
>>>>
>>>> I also discovered that when a service is removed, it remains
>>>> advertised for a default time of 120 seconds, this results in
>>>> time.sleep(120) calls being required for tests to be successful.
>>>>
>>>> cheers
>>>>
>>>> Matt
>>>> _______________________________________________
>>>> caiman-discuss mailing list
>>>> [email protected]
>>>> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
>>> _______________________________________________
>>> caiman-discuss mailing list
>>> [email protected]
>>> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
>
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss