I have been investigating what it would take inside the autotest code to return 
a non-0 status.

Well, this is getting to be more complicated than I first thought (at least for 
this novice).

It looks like the web service which the cli connects to treats all requests 
like "tell me about system with this pattern". So, 'host list xyz" is no 
different than 'host list x*' which is no different than 'host list'.

I suppose the cli code could special case an empty return for specific systems 
to a non-zero status.   I don't like special cases unless they are really 
necessary.

Additionally, the calling script/program could look for an empty return and 
handle the special case.

So, I guess the code is "doing what was intended".
ray spear

-----Original Message-----
From: Spear, Raymond (Mission Critical Linux) 
Sent: Monday, June 25, 2012 8:47 AM
To: 'Cleber Rosa'
Cc: [email protected]
Subject: RE: [Autotest] Defect?

humm... playing with this futher.

What should this do:

autotest-rpc-client host list badhost goodhost

It will fail to find "badhost"  but it will find "goodhost".

One can make the argument that the command failed to find ALL systems and 
should exit non-zero.  But on the other hand it did find some and so wasn't a 
"total failure".   Is there the need for a "tri-state" exit??
       0 - all systems listed found
       1 - no systems listed found
       2 - some systems listed found

ray spear

-----Original Message-----
From: Cleber Rosa [mailto:[email protected]] 
Sent: Friday, June 22, 2012 1:57 PM
To: Spear, Raymond (Mission Critical Linux)
Cc: [email protected]
Subject: Re: [Autotest] Defect?

On 06/22/2012 04:40 PM, Spear, Raymond (Mission Critical Linux) wrote:
> $ /usr/local/autotest/cli/atest host list xyz; echo $?
> Unknown host(s):
>          xyz
> 0
>
> Should this really return 0.  It failed to find the host.  I expected it to 
> return 1.

Yes, you have a valid point. IMHO

$ autotest-rpc-client host list

should return zero even if not hosts are listed, but when asking for a specific 
non-existing host like you did, should return non zero.

Care to send a patch?

Thanks,
CR.

> ray spear
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest


_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to