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/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/1267 Use IPA module for vty tests Replace hackish ipa_send_* routines with proper implementation from IPA module thus making it part of extended tests. Change-Id: If13ed7fd243ce3aeef505d2e8468e221aa62f79e --- M openbsc/tests/vty_test_runner.py 1 file changed, 9 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/67/1267/1 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index a73dadd..b909623 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -15,13 +15,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import os +import os, sys import time import unittest import socket import osmopy.obscvty as obscvty import osmopy.osmoutil as osmoutil + +sys.path.append("../contrib") +from ipa import IPA confpath = '.' @@ -912,13 +915,13 @@ self.assertEqual(data, "\x00\x01\xfe\x04") print "Going to send ID_RESP response" - res = ipa_send_resp(ussdSocket, "\x6b\x65\x79") + res = ussdSocket.send(IPA().id_resp(IPA().tag_name('key'))) self.assertEqual(res, 10) # initiating PING/PONG cycle to know, that the ID_RESP message has been processed print "Going to send PING request" - res = ipa_send_ping(ussdSocket) + res = ussdSocket.send(IPA().ping()) self.assertEqual(res, 4) print "Expecting PONG response" @@ -1185,31 +1188,6 @@ test = unittest.TestLoader().loadTestsFromTestCase(TestVTYNAT) suite.addTest(test) -def ipa_send_pong(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: PONG!" - return x.send("\x00\x01\xfe\x01") - -def ipa_send_ping(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: PING?" - return x.send("\x00\x01\xfe\x00") - -def ipa_send_ack(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: IPA ID ACK" - return x.send("\x00\x01\xfe\x06") - -def ipa_send_reset(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: RESET" - return x.send("\x00\x12\xfd\x09\x00\x03\x05\x07\x02\x42\xfe\x02\x42\xfe\x06\x00\x04\x30\x04\x01\x20") - -def ipa_send_resp(x, tk, verbose = False): - if (verbose): - print "\tBSC -> NAT: IPA ID RESP" - return x.send("\x00\x07\xfe\x05\x00\x04\x01" + tk) - def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") @@ -1265,11 +1243,11 @@ if "0001fe00" == s: if (verbose): print "\tBSC <- NAT: PING?" - ipa_send_pong(x, verbose) + x.send(IPA().pong()) elif "0001fe06" == s: if (verbose): print "\tBSC <- NAT: IPA ID ACK" - ipa_send_ack(x, verbose) + x.send(IPA().id_ack()) elif "0001fe00" == s: if (verbose): print "\tBSC <- NAT: PONG!" @@ -1280,7 +1258,7 @@ def ipa_handle_resp(x, tk, verbose = False): s = data2str(x.recv(38)) if "0023fe040108010701020103010401050101010011" in s: - ipa_send_resp(x, tk, verbose) + x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) else: if (verbose): print "\tBSC <- NAT: ", s -- To view, visit https://gerrit.osmocom.org/1267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If13ed7fd243ce3aeef505d2e8468e221aa62f79e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>