Change in osmo-gsm-tester[master]: util: fix the functions "create_netns" and "setcap_netsys_admin".

2021-06-15 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678 )

Change subject: util: fix the functions "create_netns" and 
"setcap_netsys_admin".
..

util: fix the functions "create_netns" and "setcap_netsys_admin".

This commit fixes 2 functions from util.py:
 - setcap_netsys_admin: removed "self" from the arguments.
 - create_netns: pass "run_dir" to Process and convert the arguments to
a list as the other methods in the file.

Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
---
M src/osmo_gsm_tester/core/util.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/core/util.py b/src/osmo_gsm_tester/core/util.py
index 691b489..5ca6ad9 100644
--- a/src/osmo_gsm_tester/core/util.py
+++ b/src/osmo_gsm_tester/core/util.py
@@ -102,7 +102,7 @@
 proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', 
SETCAP_NET_ADMIN_BIN, binary])
 proc.launch_sync()

-def setcap_netsys_admin(self, binary, run_dir):
+def setcap_netsys_admin(binary, run_dir):
 '''
 This functionality requires specific setup on the host running
 osmo-gsm-tester. See osmo-gsm-tester manual for more information.
@@ -118,7 +118,7 @@
 '''
 from .process import Process
 NETNS_SETUP_BIN = 'osmo-gsm-tester_netns_setup.sh'
-proc = Process('create_netns', ('sudo', NETNS_SETUP_BIN, netns))
+proc = Process('create_netns',run_dir, ['sudo', NETNS_SETUP_BIN, netns])
 proc.launch_sync()

 def move_iface_to_netns(ifname, netns, run_dir):

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
Gerrit-Change-Number: 24678
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: util: fix the functions "create_netns" and "setcap_netsys_admin".

2021-06-15 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678 )

Change subject: util: fix the functions "create_netns" and 
"setcap_netsys_admin".
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
Gerrit-Change-Number: 24678
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 15 Jun 2021 16:47:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: fix the functions "create_netns" and "setcap_netsys_admin".

2021-06-15 Thread alealcon
alealcon has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678 )

Change subject: util: fix the functions "create_netns" and 
"setcap_netsys_admin".
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678/1//COMMIT_MSG@11
PS1, Line 11:  - create_netns: pass "run_dir" to Process and convert the 
arguments to
> ACK for the first. For the second, It's not really a fix since it works fine 
> anyway. […]
It doesn't work. The local one uses the Process class, with the constructor
def __init__(self, name, run_dir, popen_args, **popen_kwargs):

and it needs the run_dir or it crashed because it mismatches the args with the 
run_dir.

remote.py uses the RemoteProcess function with a different arguments:

def RemoteProcess(self, name, popen_args, remote_env={}, **popen_kwargs):


It's true that remote.py uses () instead [], but in utils.py almost all the 
methods use [], so I wanted to be consistent within that file. If you prefer () 
only for that function I can update the commit



--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
Gerrit-Change-Number: 24678
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 15 Jun 2021 16:44:43 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: fix the functions "create_netns" and "setcap_netsys_admin".

2021-06-15 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678 )

Change subject: util: fix the functions "create_netns" and 
"setcap_netsys_admin".
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678/1//COMMIT_MSG@11
PS1, Line 11:  - create_netns: pass "run_dir" to Process and convert the 
arguments to
ACK for the first. For the second, It's not really a fix since it works fine 
anyway.

Furthermore, there's a "copy" of the function in remote.py, and this one from 
util.py is only used when running a ms_srs locally we nobody usually does. But 
the copy in remote.py is also using () instead of []. So please have a looks 
what's the best and submit a different commit if needed changing both.



--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
Gerrit-Change-Number: 24678
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 15 Jun 2021 16:10:18 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: fix the functions "create_netns" and "setcap_netsys_admin".

2021-06-15 Thread alealcon
alealcon has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678 )


Change subject: util: fix the functions "create_netns" and 
"setcap_netsys_admin".
..

util: fix the functions "create_netns" and "setcap_netsys_admin".

This commit fixes 2 functions from util.py:
 - setcap_netsys_admin: removed "self" from the arguments.
 - create_netns: pass "run_dir" to Process and convert the arguments to
a list as the other methods in the file.

Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
---
M src/osmo_gsm_tester/core/util.py
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/78/24678/1

diff --git a/src/osmo_gsm_tester/core/util.py b/src/osmo_gsm_tester/core/util.py
index 691b489..5ca6ad9 100644
--- a/src/osmo_gsm_tester/core/util.py
+++ b/src/osmo_gsm_tester/core/util.py
@@ -102,7 +102,7 @@
 proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', 
SETCAP_NET_ADMIN_BIN, binary])
 proc.launch_sync()
 
-def setcap_netsys_admin(self, binary, run_dir):
+def setcap_netsys_admin(binary, run_dir):
 '''
 This functionality requires specific setup on the host running
 osmo-gsm-tester. See osmo-gsm-tester manual for more information.
@@ -118,7 +118,7 @@
 '''
 from .process import Process
 NETNS_SETUP_BIN = 'osmo-gsm-tester_netns_setup.sh'
-proc = Process('create_netns', ('sudo', NETNS_SETUP_BIN, netns))
+proc = Process('create_netns',run_dir, ['sudo', NETNS_SETUP_BIN, netns])
 proc.launch_sync()

 def move_iface_to_netns(ifname, netns, run_dir):

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24678
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ida4c6d6500be92b8d1f96e4e7a870e63bd329be9
Gerrit-Change-Number: 24678
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-MessageType: newchange