osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Sep 8 23:24:38 UTC 2017


Patch Set 1: Code-Review+1

(5 comments)

If you like revisit the minor things I commented, but would already pass for a +2 which you may hand out to yourself any time.

https://gerrit.osmocom.org/#/c/3894/1/src/osmo_gsm_tester/bts_osmotrx.py
File src/osmo_gsm_tester/bts_osmotrx.py:

Line 44:         self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None)
lol, what is octopusk?

more obvious would be 'osmo-gsm-tester' to indicate where it came from


Line 45:         if len(self.pcu_socket_path().encode()) > 107:
nice, you thought of encode(), I'd have missed that.


Line 52:             except OSError:
for completeness sake we could log the error. not very important though.


Line 54:             os.rmdir(self.pcu_sk_tmp_dir)
what if removing the socket file failed or the dir is nonempty for any odd reason? do we want to crash the test? I guess we want this in a try..except too.


Line 56:     def pcu_socket_path(self):
small cosmetic: first init self.pcu_sk_tmp_dir with None and create the dir only when pcu_socket_path() is invoked the first time -- this way in setups like unit tests we can instantiate this class without creating dirs in the file system right away.

(Then also move the length sanity check along into this func.)


-- 
To view, visit https://gerrit.osmocom.org/3894
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list