summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-19 15:02:22 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-19 15:02:22 +0200
commit4cd403960d34a240e9613e01cbe2e21c9e5918b9 (patch)
treef52826347e7e8cb59ac7e209e04dc29f575ce9a6
parentf453b4cc4874b20392421a98e59c851242300cf9 (diff)
test: Add a ussd test for an issue seen at the 30C3
I don't have all the details from the 30C3 in mind anymore but the interrogateSS lead to phones being un-happy.
-rw-r--r--ussd/USSDTest.st76
1 files changed, 76 insertions, 0 deletions
diff --git a/ussd/USSDTest.st b/ussd/USSDTest.st
new file mode 100644
index 0000000..e5732b7
--- /dev/null
+++ b/ussd/USSDTest.st
@@ -0,0 +1,76 @@
+"
+ (C) 2012 by Holger Hans Peter Freyther
+ All Rights Reserved
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+
+PackageLoader fileInPackage: #FakeBTS.
+
+FakeBTS.OpenBSCTest subclass: USSDTest [
+ <import: OsmoGSM>
+
+ USSDTest class >> registerMessage [
+ ^#[16r1B 16r3B 16r1C 16r15 16rA1 16r13 16r02
+ 16r01 16r04 16r02 16r01 16r3B 16r30 16r0B
+ 16r04 16r01 16r0F 16r04 16r06 16rAA 16r51
+ 16r0C 16r06 16r1B 16r01 16r7F 16r01 16r00]
+ ]
+
+ USSDTest class >> interrogateSS [
+ ^#[16r1B 16r7B 16r1C 16r0D 16rA1 16r0B 16r02
+ 16r01 16r01 16r02 16r01 16r0E 16r30 16r03
+ 16r04 16r01 16r11 16r7F 16r01 16r00]
+ ]
+
+ startTest [
+ "1. Connect to the BTS"
+" bts := self createBTS.
+ bts btsId: '106/0/0'.
+ bts connect: '192.168.46.1'.
+ bts waitForBTSReady."
+ self createAndConnectBTS: '1234/0/0'.
+
+ self
+ testUSSDMessage
+ ]
+
+ testUSSDMessage [
+ | tmsi cm lchan |
+
+ tmsi := self allocateTmsi: '901010000001111'.
+
+ "2. Get a LCHAN"
+ lchan := self requireAnyChannel.
+
+ "3. Send a CM Service Request "
+ cm := GSM48CMServiceReq new.
+ cm mi tmsi: tmsi.
+ lchan sendGSM: cm toMessage.
+
+ "4. USSD messages"
+ lchan sendGSM: self class interrogateSS sapi: 3.
+
+ stdin next.
+ ]
+]
+
+Eval [
+ | test |
+
+ test := USSDTest new
+ startTest;
+ stopBts;
+ yourself.
+]