Message ID | 1466702196-26828-2-git-send-email-jonathan@wizery.com |
---|---|
State | Accepted |
Headers | show |
diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py index cba9271..1f4017f 100644 --- a/tests/hwsim/hwsim_utils.py +++ b/tests/hwsim/hwsim_utils.py @@ -173,6 +173,8 @@ def test_connectivity_sta(dev1, dev2, dscp=None, tos=None): def set_powersave(dev, val): phy = dev.get_driver_status_field("phyname") - psf = open('/sys/kernel/debug/ieee80211/%s/hwsim/ps' % phy, 'w') - psf.write('%d\n' % val) - psf.close() + fname = '/sys/kernel/debug/ieee80211/%s/hwsim/ps' % phy + data = '%d' % val + (res, data) = dev.cmd_execute(["echo", data, ">", fname]) + if 0 != res: + raise Exception("failed to set power save for device")
The hwsim_utils used to do file operations locally in python. Start using the cmd_execute() general function for file operations so that this would also work on remote setups. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com> --- tests/hwsim/hwsim_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)