Skip to content

Commit

Permalink
Merge pull request #422 from jookies/v0.9
Browse files Browse the repository at this point in the history
v0.9b3
  • Loading branch information
farirat committed Apr 24, 2016
2 parents 2450634 + 636ed9f commit 0645b89
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: python
python:
- '2.7'
env:
- ROOT_PATH=~/jasmin JASMIN_RELEASE=0.9b2
- ROOT_PATH=~/jasmin JASMIN_RELEASE=0.9b3
# Command to install dependencies
install:
- python setup.py sdist
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MAINTAINER Jookies LTD <jasmin@jookies.net>
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r jasmin && useradd -r -g jasmin jasmin

ENV JASMIN_VERSION 0.9b2
ENV JASMIN_VERSION 0.9b3

# Install requirements
RUN apt-get update && apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion jasmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

MAJOR = 0
MINOR = 9
PATCH = 2
PATCH = 3
META = 'b'

def get_version():
Expand Down
9 changes: 6 additions & 3 deletions jasmin/managers/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,14 @@ def perspective_load(self, profile='jcli-prod'):
cf = ConfigurationMigrator(context='smppccs', header=lines[0], data=''.join(lines[1:]))

# Remove current configuration
CIDs = []
for c in self.connectors:
remRet = yield self.perspective_connector_remove(c['id'])
CIDs.append(c['id'])
for cid in CIDs:
remRet = yield self.perspective_connector_remove(cid)
if not remRet:
raise ConfigProfileLoadingError('Error removing connector %s' % c['id'])
self.log.info('Removed connector [%s]', c['id'])
raise ConfigProfileLoadingError('Error removing connector %s' % cid)
self.log.info('Removed connector [%s]', cid)

# Apply configuration
loadedConnectors = cf.getMigratedData()
Expand Down
24 changes: 24 additions & 0 deletions jasmin/managers/test/test_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,30 @@ def test_persitance_flag(self):
self.assertFalse(isPersisted)
yield self.persist('profile')

@defer.inlineCallbacks
def test_add_many_persist_and_load_default(self):
"Related to #420"
yield self.connect('127.0.0.1', self.pbPort)

# Add many
yield self.add(SMPPClientConfig(id='IPBANK'))
yield self.add(SMPPClientConfig(id='UPBANK'))
yield self.add(SMPPClientConfig(id='ITEL'))
yield self.add(SMPPClientConfig(id='MOBILMATIC'))
yield self.add(SMPPClientConfig(id='SMSGH'))
listRet = yield self.connector_list()
self.assertEqual(5, len(listRet))

# Persist
yield self.persist()

# Load
yield self.load()

# List and assert
listRet = yield self.connector_list()
self.assertEqual(5, len(listRet))

class ClientConnectorTestCases(SMPPClientPBProxyTestCase):
@defer.inlineCallbacks
def test_add_and_list(self):
Expand Down
4 changes: 4 additions & 0 deletions jasmin/protocols/smpp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ def preSubmitSm(self, pdu):
else:
pdu.params['data_coding'] = None

# Set default source_addr if not defined
if pdu.params['source_addr'] is None and self.config().source_addr is not None:
pdu.params['source_addr'] = self.config().source_addr

def doSendRequest(self, pdu, timeout):
if self.connectionCorrupted:
raise SMPPClientConnectionCorruptedError()
Expand Down
2 changes: 1 addition & 1 deletion jasmin/protocols/smpp/test/smsc_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def sendSubmitSmResponse(self, reqPDU):

self.lastSubmitSmRestPDU = reqPDU.requireAck(reqPDU.seqNum,
status=CommandStatus.ESME_ROK,
message_id = msgid,
message_id=msgid,
)
self.sendPDU(self.lastSubmitSmRestPDU)

Expand Down

0 comments on commit 0645b89

Please sign in to comment.