Good catch. Here's the patch to fix the enable_ipfilter() which will now use
path_exists().

Kelly


On Mon, Mar 8, 2010 at 7:38 AM, John Admanski <[email protected]> wrote:

> Using os.path.isfile in the host class isn't going to work if you're trying
> to check if something is a file on the remote machine.
>
> -- John
>
>
> On Fri, Mar 5, 2010 at 3:47 PM, K.D. Lucas <[email protected]> wrote:
>
>> Ok, I implemented your suggestions. I originally put a couple of methods
>> in client/bin/net/net_utils.py, but this didn't really work well for server
>> jobs. So, the attached patch now adds two methods to
>> client/common_lib/hosts/base_classes.py, and it stores the current state so
>> when you enable IPFiltering it will restore to it's previous state.
>>
>> patch is attached.
>>
>> I tested this running netperf2 server side test.
>>
>> kdl
>>
>>
>> On Mon, Mar 1, 2010 at 12:21 PM, Martin Bligh <[email protected]> wrote:
>>
>>> iptables:
>>>
>>> is probably worth checking iptables is running on the system (binaries
>>> there and kernel has support) before trying to configure it ... and it
>>> should probably get reset back somehow after use?
>>>
>>> maybe also move this to an abstraction in net_utils, since two callers
>>> use it (eg disable_firewall(), then have the cleanup() test method call
>>> reenable_firewall() or something).
>>>
>>> On Fri, Feb 26, 2010 at 4:40 PM, K.D. Lucas <[email protected]> wrote:
>>> > So I've split the netpipe and netperf control files into separate
>>> control
>>> > files and a .py file for each one, so that it will be easier to add
>>> > additional tests that use the logic of the python scripts without
>>> > duplicating code.
>>> > I'm also taking advantage of the new added function to get the
>>> > platform_label, as in my testbed I have assigned a net_server platform
>>> label
>>> > for the machines I want to use as the network side of these tests.
>>> > Let me know your thoughts on this, as some of you might think the
>>> stress
>>> > version of these tests belongs in a site_tests directory. But
>>> definitely
>>> > splitting the code out with the reusable code in a separate python
>>> scripts
>>> > seems like a good idea.
>>> > Regards,
>>> > Kelly
>>> > --
>>> > K.D. Lucas
>>> > [email protected]
>>> >
>>> > _______________________________________________
>>> > Autotest mailing list
>>> > [email protected]
>>> > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>>> >
>>> >
>>>
>>
>>
>>
>> --
>> K.D. Lucas
>> [email protected]
>>
>> _______________________________________________
>> Autotest mailing list
>> [email protected]
>> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>>
>>
>


-- 
K.D. Lucas
[email protected]
Index: client/common_lib/hosts/base_classes.py
===================================================================
--- client/common_lib/hosts/base_classes.py	(revision 4288)
+++ client/common_lib/hosts/base_classes.py	(working copy)
@@ -430,7 +430,7 @@
 
     def enable_ipfilters(self):
         """Re-enable the IP filters disabled from disable_ipfilters()"""
-        if os.path.isfile('/tmp/iptable-rules'):
+        if self.path_exists('/tmp/iptable-rules'):
             self.run('iptables-restore < /tmp/iptable-rules')
 
 
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to