From 4cbfc1d0be8c201416d1db153094789597b0764b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 20 Nov 2010 01:15:52 +0100 Subject: [PATCH] GSM48: Add dummy code to generate a LU and wrap it in all layers Create a GSM48 message, wrap it in BSSMAP, BSSAP, SCCP. This allows us to test the code that is wrapping messages... --- TestPhone.st | 21 +++++++++++++++++++++ Tests.st | 9 +++++++++ package.xml | 1 + 3 files changed, 31 insertions(+) diff --git a/TestPhone.st b/TestPhone.st index ecb9d84..b804b75 100644 --- a/TestPhone.st +++ b/TestPhone.st @@ -83,3 +83,24 @@ Object subclass: IPAConfig [ semaphore [ ^ sem ] ] +Object subclass: MessageTests [ + MessageTests class >> createLU [ + | lu gsm48 gsm88 msg sccp | + gsm48 := Osmo.MessageBuffer new. + gsm88 := Osmo.MessageBuffer new. + lu := LocationUpdatingRequest new. + lu mi imsi: '666666666666'. + lu storeOn: gsm48. + + msg := IEMessage initWith: GSM0808Helper msgComplL3. + msg addIe: (GSMCellIdentifier initWith: 274 mnc: 8 lac: 4099 ci: 40000). + msg addIe: (GSMLayer3Info initWith: gsm48 asByteArray). + msg storeOn: gsm88. + + BSSAPHelper prependManagement: gsm88. + + sccp := Osmo.SCCPHelper createCR: 666 dest: (Osmo.SCCPAddress createWith: 254) data: gsm88 asByteArray. + sccp asByteArray printNl. + ^ sccp asByteArray. + ] +] diff --git a/Tests.st b/Tests.st index ab4b510..d203829 100644 --- a/Tests.st +++ b/Tests.st @@ -117,3 +117,12 @@ TestCase subclass: GSM48Test [ self assert: msg asByteArray = #(5 8 112 2 242 80 255 254 51 8 105 102 1 69 0 114 131 136) asByteArray. ] ] + +TestCase subclass: TestMessages [ + testLU [ + | sccp | + + sccp := MessageTests createLU. + self assert: sccp = #(1 154 2 0 2 2 4 2 66 254 15 32 0 30 87 5 8 0 114 244 128 16 3 156 64 23 17 5 8 112 0 240 0 0 0 51 7 97 102 102 102 102 102 246 0 ) asByteArray. + ] +] diff --git a/package.xml b/package.xml index ece18f8..00e11f2 100644 --- a/package.xml +++ b/package.xml @@ -15,6 +15,7 @@ OsmoTestPhone.GSM0808Test OsmoTestPhone.BSSAPTest OsmoTestPhone.GSM48Test + OsmoTestPhone.TestMessages Tests.st