From f453b4cc4874b20392421a98e59c851242300cf9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 19 Apr 2014 15:00:17 +0200 Subject: [PATCH] test: Add a DoubleRelease for something seen on a Rhizomatica deployment The combination of SAPI=3 not being established, the T200 expiring and a general SACCH Connection Failure is apparently leading to the NITB releasing a channel twice! --- double_release/DoubleRelease.st | 91 +++++++++++++++++++++++++++++++++ double_release/README | 35 +++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 double_release/DoubleRelease.st create mode 100644 double_release/README diff --git a/double_release/DoubleRelease.st b/double_release/DoubleRelease.st new file mode 100644 index 0000000..59236fb --- /dev/null +++ b/double_release/DoubleRelease.st @@ -0,0 +1,91 @@ +" + (C) 2014 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 . +" + +PackageLoader fileInPackage: #FakeBTS. + +FakeBTS.RSLEstablishRequest extend [ + trxDispatchOn: aTrx with: lchan [ + | msg | + + + 'Got an establish request.' printNl. + msg := FakeBTS.RSLConnectionFailure new + channelNumber: self channelNumber; + cause: #[1] asRSLAttributeData; + yourself. + aTrx mainBts sendRSL: msg toMessage on: aTrx. + + msg := FakeBTS.RSLReleaseIndication new + channelNumber: self channelNumber; + linkIdentifier: self linkIdentifier; + yourself. + aTrx mainBts sendRSL: msg toMessage on: aTrx. + + msg := FakeBTS.RSLErrorIndication new + channelNumber: self channelNumber; + linkIdentifier: self linkIdentifier; + rlmCause: #[1] asRSLAttributeData; + yourself. + aTrx mainBts sendRSL: msg toMessage on: aTrx. + ] + + trxDispatchOn: aTrx [ + + self trxChannelDispatch: aTrx. + ] +] + +FakeBTS.OpenBSCTest subclass: DoubleRelease [ + | tmsi | + + IMSI := '901010000001111'. + + startTest [ + self createAndConnectBTS: '1234/0/0'. + + bts onPaging: [:id | self handlePaging: id]. + tmsi := self allocateTmsi: IMSI. + ] + + handlePaging: id [ + "Handle paging for TMSI2" + id tmsi = tmsi ifFalse: [^self]. + + "Run it on another process" + [self handlePagingResponse] fork. + ] + + handlePagingResponse [ + | lchan msg ti | + "Handle paging response..." + lchan := self requireAnyChannel. + msg := GSM48RRPagingResponse new. + msg mi tmsi: tmsi. + lchan sendGSM: msg toMessage. + + Semaphore new wait. + ] +] + +Eval [ + DoubleRelease new + startTest. + + 'Waiting to the end' printNl. + Semaphore new wait. +] diff --git a/double_release/README b/double_release/README new file mode 100644 index 0000000..55ce51b --- /dev/null +++ b/double_release/README @@ -0,0 +1,35 @@ +This tests some odd LAPDm and MS behavior that leads to a double +RF Channel Release by the BSC/NITB. + +It is a manual test right now. After the LU a SMS needs to be +queued through the VTY and then the error/failure sequence will +be sent to the BSC. + +The test is passed when no exceptions like the below are raised + +An instance of SystemExceptions.NotFound + creator: Dictionary ( +) + tag: an Object + messageText: 'key not found' + resumeBlock: a BlockClosure + onDoBlock: a BlockClosure + handlerBlock: a BlockClosure + context: BlockClosure>>on:do: (BlkClosure.st:196) + isNested: nil + previousState: 0 + value: 0 +With data: ByteArray (2 7 1 32 2 0 20 1 ) +RSL Parsing failed with +An instance of Error + creator: a LogicalChannel + tag: an Object + messageText: 'Lchan was not allocated.' + resumeBlock: a BlockClosure + onDoBlock: a BlockClosure + handlerBlock: a BlockClosure + context: BlockClosure>>on:do: (BlkClosure.st:196) + isNested: nil + previousState: 0 +With data: ByteArray (8 46 1 32 ) +