From 7ad811e8d76d004cc55a7b4a4cc8637df260e42d Mon Sep 17 00:00:00 2001 From: Ulas Kozat Date: Thu, 1 Dec 2016 12:12:03 -0800 Subject: JIRA Issue DOMINO-24 Change-Id: Id45f86b7b8f88dcdcdc724942c5109eaf1d3d193 Signed-off-by: Ulas Kozat --- DominoClient.py | 11 ++-- DominoServer.py | 33 +++++------ domino.thrift | 24 ++++---- domino_conf.py | 5 +- lib/dominoRPC/ttypes.py | 120 ++++++++++++++++++++-------------------- tests/logdata/client1.log | 66 +++++++++++----------- tests/logdata/server.log | 78 +++++++++++++------------- tests/refdata/test1_client1.ref | 22 ++++---- tests/refdata/test1_client2.ref | 2 +- 9 files changed, 181 insertions(+), 180 deletions(-) diff --git a/DominoClient.py b/DominoClient.py index 0b2ddd3..39eceaa 100755 --- a/DominoClient.py +++ b/DominoClient.py @@ -15,6 +15,7 @@ import sys, os, glob, threading import getopt, socket import logging, errno +import uuid #sys.path.append('gen-py') #sys.path.insert(0, glob.glob('./lib/py/build/lib.*')[0]) @@ -55,7 +56,7 @@ class CommunicationHandler: # - Depending on Controller Domain, call API # - Respond Back with Push Response def d_push(self, push_msg): - logging.info('%d Received Template File', self.dominoClient.UDID) + logging.info('%s Received Template File', self.dominoClient.UDID) # Retrieve the template file try: os.makedirs(TOSCA_RX_DIR+str(self.dominoClient.UDID)) @@ -305,14 +306,14 @@ class DominoClient: if self.state == 'UNREGISTERED': self.start() - logging.info('%d Sending heartbeat', self.UDID) + logging.info('%s Sending heartbeat', self.UDID) hbm = HeartBeatMessage() hbm.domino_udid = self.UDID hbm.seq_no = self.seqno try: hbm_r = self.sender().d_heartbeat(hbm) - logging.info('heart beat received from: %d ,sequence number: %d' , hbm_r.domino_udid, hbm_r.seq_no) + logging.info('heart beat received from: %s ,sequence number: %d' , hbm_r.domino_udid, hbm_r.seq_no) except (Thrift.TException, TSocket.TTransportException) as tx: logging.error('%s' , tx.message) except (socket.timeout) as tx: @@ -339,7 +340,7 @@ class DominoClient: return try: pub_msg_r = self.sender().d_publish(pub_msg) - logging.info('Publish Response is received from: %d ,sequence number: %d Status: %d', pub_msg_r.domino_udid, pub_msg_r.seq_no, pub_msg_r.responseCode) + logging.info('Publish Response is received from: %s ,sequence number: %d Status: %d', pub_msg_r.domino_udid, pub_msg_r.seq_no, pub_msg_r.responseCode) except (Thrift.TException, TSocket.TTransportException) as tx: print '%s' % (tx.message) except (socket.timeout) as tx: @@ -362,7 +363,7 @@ class DominoClient: sub_msg.labels = labels try: sub_msg_r = self.sender().d_subscribe(sub_msg) - logging.info('Subscribe Response is received from: %d ,sequence number: %d', sub_msg_r.domino_udid,sub_msg_r.seq_no) + logging.info('Subscribe Response is received from: %s ,sequence number: %d', sub_msg_r.domino_udid,sub_msg_r.seq_no) except (Thrift.TException, TSocket.TTransportException) as tx: logging.error('%s' , tx.message) except (socket.timeout) as tx: diff --git a/DominoServer.py b/DominoServer.py index 9530170..e7ee04a 100755 --- a/DominoServer.py +++ b/DominoServer.py @@ -15,6 +15,7 @@ import sys, os, glob, random, errno import getopt, socket import logging, json import sqlite3, yaml +import uuid #sys.path.append('gen-py') #sys.path.insert(0, glob.glob('./lib/py/build/lib.*')[0]) sys.path.insert(0, glob.glob('./lib')[0]) @@ -82,7 +83,7 @@ class CommunicationHandler: pushm.template = template try: push_r = self.sender.d_push(pushm) - logging.info('Push Response received from %d' , push_r.domino_udid) + logging.info('Push Response received from %s' , push_r.domino_udid) except (Thrift.TException, TSocket.TTransportException) as tx: logging.error('%s' , tx.message) except (socket.timeout) as tx: @@ -99,7 +100,7 @@ class CommunicationHandler: # - Respond Back with a heartbeat def d_heartbeat(self, hb_msg): - logging.info('heartbeat received from %d' , hb_msg.domino_udid) + logging.info('heartbeat received from %s' , hb_msg.domino_udid) hb_r = HeartBeatMessage() hb_r.domino_udid = SERVER_UDID @@ -117,7 +118,7 @@ class CommunicationHandler: #Prepare and send Registration Response reg_r = RegisterResponseMessage() - logging.info('Registration Request received for UDID %d from IP: %s port: %d', reg_msg.domino_udid_desired, reg_msg.ipaddr, reg_msg.tcpport) + logging.info('Registration Request received for UUID %s from IP: %s port: %d', reg_msg.domino_udid_desired, reg_msg.ipaddr, reg_msg.tcpport) reg_r.domino_udid_assigned = self.dominoServer.assign_udid(reg_msg.domino_udid_desired) @@ -142,9 +143,9 @@ class CommunicationHandler: newrow = [(reg_r.domino_udid_assigned, reg_msg.ipaddr, reg_msg.tcpport, ','.join(reg_msg.supported_templates), reg_msg.seq_no),] c.executemany('INSERT INTO clients VALUES (?,?,?,?,?)',newrow) except sqlite3.OperationalError as ex: - logging.error('Could not add the new registration record into %s for Domino Client %d : %s', SERVER_DBFILE, reg_r.domino_udid_assigned, ex.message) + logging.error('Could not add the new registration record into %s for Domino Client %s : %s', SERVER_DBFILE, reg_r.domino_udid_assigned, ex.message) except: - logging.error('Could not add the new registration record into %s for Domino Client %d', SERVER_DBFILE, reg_r.domino_udid_assigned) + logging.error('Could not add the new registration record into %s for Domino Client %s', SERVER_DBFILE, reg_r.domino_udid_assigned) logging.error('Unexpected error: %s', sys.exc_info()[0]) dbconn.commit() @@ -158,7 +159,7 @@ class CommunicationHandler: # - Save the templates & labels # - Respond Back with Subscription Response def d_subscribe(self, sub_msg): - logging.info('Subscribe Request received from %d' , sub_msg.domino_udid) + logging.info('Subscribe Request received from %s' , sub_msg.domino_udid) if sub_msg.template_op == APPEND: if self.dominoServer.subscribed_templateformats.has_key(sub_msg.domino_udid): @@ -194,9 +195,9 @@ class CommunicationHandler: c.execute("REPLACE INTO labels (udid, label_list) VALUES ({udid}, '{newvalue}')".\ format(udid=sub_msg.domino_udid, newvalue=','.join(list(newlabelset)) )) except sqlite3.OperationalError as ex1: - logging.error('Could not add the new labels to %s for Domino Client %d : %s', SERVER_DBFILE, sub_msg.domino_udid, ex1.message) + logging.error('Could not add the new labels to %s for Domino Client %s : %s', SERVER_DBFILE, sub_msg.domino_udid, ex1.message) except: - logging.error('Could not add the new labels to %s for Domino Client %d', SERVER_DBFILE, sub_msg.domino_udid) + logging.error('Could not add the new labels to %s for Domino Client %s', SERVER_DBFILE, sub_msg.domino_udid) logging.error('Unexpected error: %s', sys.exc_info()[0]) newttypeset = self.dominoServer.subscribed_templateformats[sub_msg.domino_udid] @@ -204,9 +205,9 @@ class CommunicationHandler: c.execute("REPLACE INTO ttypes (udid, ttype_list) VALUES ({udid}, '{newvalue}')".\ format(udid=sub_msg.domino_udid, newvalue=','.join(list(newttypeset)) )) except sqlite3.OperationalError as ex1: - logging.error('Could not add the new labels to %s for Domino Client %d : %s', SERVER_DBFILE, sub_msg.domino_udid, ex1.message) + logging.error('Could not add the new labels to %s for Domino Client %s : %s', SERVER_DBFILE, sub_msg.domino_udid, ex1.message) except: - logging.error('Could not add the new labels to %s for Domino Client %d', SERVER_DBFILE, sub_msg.domino_udid) + logging.error('Could not add the new labels to %s for Domino Client %s', SERVER_DBFILE, sub_msg.domino_udid) logging.error('Unexpected error: %s', sys.exc_info()[0]) @@ -229,7 +230,7 @@ class CommunicationHandler: # - Launch Push service # - Respond Back with Publication Response def d_publish(self, pub_msg): - logging.info('Publish Request received from %d' , pub_msg.domino_udid) + logging.info('Publish Request received from %s' , pub_msg.domino_udid) logging.debug(pub_msg.template) # Save as file @@ -363,9 +364,9 @@ class DominoServer: #If assigned, offer a new random id def assign_udid(self, udid_desired): if udid_desired in self.assignedUUIDs: - new_udid = random.getrandbits(63) + new_udid = uuid.uuid4().hex #random.getrandbits(63) while new_udid in self.assignedUUIDs: - new_udid = random.getrandbits(63) + new_udid = uuid.uuid4().hex #random.getrandbits(63) self.assignedUUIDs.append(new_udid) return new_udid @@ -409,17 +410,17 @@ def main(argv): dbconn = sqlite3.connect(SERVER_DBFILE) c = dbconn.cursor() try: - c.execute('''CREATE TABLE labels (udid INTEGER PRIMARY KEY, label_list TEXT)''') + c.execute('''CREATE TABLE labels (udid TEXT PRIMARY KEY, label_list TEXT)''') except sqlite3.OperationalError as ex: logging.debug('In database file %s, no table is created as %s', SERVER_DBFILE, ex.message) try: - c.execute('''CREATE TABLE ttypes (udid INTEGER PRIMARY KEY, ttype_list TEXT)''') + c.execute('''CREATE TABLE ttypes (udid TEXT PRIMARY KEY, ttype_list TEXT)''') except sqlite3.OperationalError as ex: logging.debug('In database file %s, no table is created as %s', SERVER_DBFILE, ex.message) try: - c.execute('''CREATE TABLE clients (udid INTEGER PRIMARY KEY, ipaddr TEXT, tcpport INTEGER, templatetypes TEXT, seqno INTEGER)''') + c.execute('''CREATE TABLE clients (udid TEXT PRIMARY KEY, ipaddr TEXT, tcpport INTEGER, templatetypes TEXT, seqno INTEGER)''') except sqlite3.OperationalError as ex: logging.debug('In database file %s, no table is created as %s', SERVER_DBFILE, ex.message) diff --git a/domino.thrift b/domino.thrift index 72fb37f..a3335ca 100644 --- a/domino.thrift +++ b/domino.thrift @@ -100,7 +100,7 @@ exception InvalidOperation { */ struct HeartBeatMessage { 1: MessageType messageType = HEART_BEAT, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no } @@ -112,7 +112,7 @@ struct HeartBeatMessage { struct RegisterMessage { 1: MessageType messageType = REGISTER, - 2: i64 domino_udid_desired, + 2: string domino_udid_desired, 3: i64 seq_no, 4: string ipaddr, 5: i16 tcpport, @@ -121,8 +121,8 @@ struct RegisterMessage { struct RegisterResponseMessage { 1: MessageType messageType = REGISTER_RESPONSE, - 2: i64 domino_udid, - 3: i64 domino_udid_assigned, + 2: string domino_udid, + 3: string domino_udid_assigned, 4: i64 seq_no, 5: ResponseCode responseCode, 6: optional list comments @@ -130,7 +130,7 @@ struct RegisterResponseMessage { struct SubscribeMessage { 1: MessageType messageType = SUBSCRIBE, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: byte template_op, 5: list supported_template_types, @@ -140,7 +140,7 @@ struct SubscribeMessage { struct SubscribeResponseMessage { 1: MessageType messageType = SUBSCRIBE_RESPONSE, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: ResponseCode responseCode, 5: optional list comments @@ -148,7 +148,7 @@ struct SubscribeResponseMessage { struct PublishMessage { 1: MessageType messageType = PUBLISH, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: string template_type, 5: list template @@ -156,7 +156,7 @@ struct PublishMessage { struct PublishResponseMessage { 1: MessageType messageType = PUBLISH_RESPONSE, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: ResponseCode responseCode, 5: optional list comments @@ -164,7 +164,7 @@ struct PublishResponseMessage { struct PushMessage { 1: MessageType messageType = PUSH, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: string template_type, 5: list template @@ -172,7 +172,7 @@ struct PushMessage { struct PushResponseMessage { 1: MessageType messageType = PUSH_RESPONSE, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: ResponseCode responseCode, 5: optional list comments @@ -180,14 +180,14 @@ struct PushResponseMessage { struct QueryMessage{ 1: MessageType messageType = QUERY, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: list queryString } struct QueryResponseMessage{ 1: MessageType messageType = QUERY_RESPONSE, - 2: i64 domino_udid, + 2: string domino_udid, 3: i64 seq_no, 4: ResponseCode responseCode, 5: optional list queryResponse, diff --git a/domino_conf.py b/domino_conf.py index 146fd44..4a12156 100644 --- a/domino_conf.py +++ b/domino_conf.py @@ -5,20 +5,19 @@ LOGLEVEL = 'WARNING' #'WARNING' #ERROR, DEBUG, INFO DOMINO_CLIENT_PORT = 9091 INTERACTIVE = 'FALSE' -CLIENT_UDID = 1 CLIENT_SEQNO = 0 DOMINO_SERVER_IP = 'localhost' DOMINO_CLI_PORT = 9100 -UDID_DESIRED = 0 +UDID_DESIRED = '12345678123456781234567812345678' LIST_SUPPORTED_TEMPLATES = ['tosca-nfv-v1.0'] DEFAULT_TOSCA_PUBFILE = './tosca-templates/tosca_helloworld_nfv.yaml' TOSCA_RX_DIR = './toscafiles/' #Server Parameters DOMINO_SERVER_PORT = 9090 -SERVER_UDID = 0 +SERVER_UDID = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' TOSCADIR = './toscafiles/' TOSCA_DEFAULT_FNAME = 'template1.yaml' SERVER_DBFILE = 'dominoserver.db' diff --git a/lib/dominoRPC/ttypes.py b/lib/dominoRPC/ttypes.py index 8a80d5f..a37b244 100644 --- a/lib/dominoRPC/ttypes.py +++ b/lib/dominoRPC/ttypes.py @@ -31,7 +31,7 @@ class HeartBeatMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 1, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 ) @@ -57,8 +57,8 @@ class HeartBeatMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -81,8 +81,8 @@ class HeartBeatMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -131,7 +131,7 @@ class RegisterMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 2, ), # 1 - (2, TType.I64, 'domino_udid_desired', None, None, ), # 2 + (2, TType.STRING, 'domino_udid_desired', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.STRING, 'ipaddr', None, None, ), # 4 (5, TType.I16, 'tcpport', None, None, ), # 5 @@ -163,8 +163,8 @@ class RegisterMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid_desired = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid_desired = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -207,8 +207,8 @@ class RegisterMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid_desired is not None: - oprot.writeFieldBegin('domino_udid_desired', TType.I64, 2) - oprot.writeI64(self.domino_udid_desired) + oprot.writeFieldBegin('domino_udid_desired', TType.STRING, 2) + oprot.writeString(self.domino_udid_desired) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -271,8 +271,8 @@ class RegisterResponseMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 3, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 - (3, TType.I64, 'domino_udid_assigned', None, None, ), # 3 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 + (3, TType.STRING, 'domino_udid_assigned', None, None, ), # 3 (4, TType.I64, 'seq_no', None, None, ), # 4 (5, TType.BYTE, 'responseCode', None, None, ), # 5 (6, TType.LIST, 'comments', (TType.STRING,None), None, ), # 6 @@ -303,13 +303,13 @@ class RegisterResponseMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: - if ftype == TType.I64: - self.domino_udid_assigned = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid_assigned = iprot.readString() else: iprot.skip(ftype) elif fid == 4: @@ -347,12 +347,12 @@ class RegisterResponseMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.domino_udid_assigned is not None: - oprot.writeFieldBegin('domino_udid_assigned', TType.I64, 3) - oprot.writeI64(self.domino_udid_assigned) + oprot.writeFieldBegin('domino_udid_assigned', TType.STRING, 3) + oprot.writeString(self.domino_udid_assigned) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 4) @@ -412,7 +412,7 @@ class SubscribeMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 4, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.BYTE, 'template_op', None, None, ), # 4 (5, TType.LIST, 'supported_template_types', (TType.STRING,None), None, ), # 5 @@ -446,8 +446,8 @@ class SubscribeMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -500,8 +500,8 @@ class SubscribeMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -571,7 +571,7 @@ class SubscribeResponseMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 5, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.BYTE, 'responseCode', None, None, ), # 4 (5, TType.LIST, 'comments', (TType.STRING,None), None, ), # 5 @@ -601,8 +601,8 @@ class SubscribeResponseMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -640,8 +640,8 @@ class SubscribeResponseMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -698,7 +698,7 @@ class PublishMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 6, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.STRING, 'template_type', None, None, ), # 4 (5, TType.LIST, 'template', (TType.STRING,None), None, ), # 5 @@ -728,8 +728,8 @@ class PublishMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -767,8 +767,8 @@ class PublishMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -825,7 +825,7 @@ class PublishResponseMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 7, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.BYTE, 'responseCode', None, None, ), # 4 (5, TType.LIST, 'comments', (TType.STRING,None), None, ), # 5 @@ -855,8 +855,8 @@ class PublishResponseMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -894,8 +894,8 @@ class PublishResponseMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -952,7 +952,7 @@ class PushMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 8, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.STRING, 'template_type', None, None, ), # 4 (5, TType.LIST, 'template', (TType.STRING,None), None, ), # 5 @@ -982,8 +982,8 @@ class PushMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -1021,8 +1021,8 @@ class PushMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -1079,7 +1079,7 @@ class PushResponseMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 9, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.BYTE, 'responseCode', None, None, ), # 4 (5, TType.LIST, 'comments', (TType.STRING,None), None, ), # 5 @@ -1109,8 +1109,8 @@ class PushResponseMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -1148,8 +1148,8 @@ class PushResponseMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -1205,7 +1205,7 @@ class QueryMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 10, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.LIST, 'queryString', (TType.STRING,None), None, ), # 4 ) @@ -1233,8 +1233,8 @@ class QueryMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -1267,8 +1267,8 @@ class QueryMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) @@ -1320,7 +1320,7 @@ class QueryResponseMessage: thrift_spec = ( None, # 0 (1, TType.BYTE, 'messageType', None, 11, ), # 1 - (2, TType.I64, 'domino_udid', None, None, ), # 2 + (2, TType.STRING, 'domino_udid', None, None, ), # 2 (3, TType.I64, 'seq_no', None, None, ), # 3 (4, TType.BYTE, 'responseCode', None, None, ), # 4 (5, TType.LIST, 'queryResponse', (TType.STRING,None), None, ), # 5 @@ -1350,8 +1350,8 @@ class QueryResponseMessage: else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.I64: - self.domino_udid = iprot.readI64() + if ftype == TType.STRING: + self.domino_udid = iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -1389,8 +1389,8 @@ class QueryResponseMessage: oprot.writeByte(self.messageType) oprot.writeFieldEnd() if self.domino_udid is not None: - oprot.writeFieldBegin('domino_udid', TType.I64, 2) - oprot.writeI64(self.domino_udid) + oprot.writeFieldBegin('domino_udid', TType.STRING, 2) + oprot.writeString(self.domino_udid) oprot.writeFieldEnd() if self.seq_no is not None: oprot.writeFieldBegin('seq_no', TType.I64, 3) diff --git a/tests/logdata/client1.log b/tests/logdata/client1.log index 7587cd8..aa24fb1 100644 --- a/tests/logdata/client1.log +++ b/tests/logdata/client1.log @@ -1,33 +1,33 @@ -11/18/2016 12:40:26 PM Domino Client Starting... -11/18/2016 12:40:26 PM 1 Sending Registration -11/18/2016 12:40:26 PM Registration Response: Response Code: 1 -11/18/2016 12:40:26 PM CLI Service is starting -11/18/2016 12:40:26 PM RPC service for CLI is starting... -11/18/2016 12:40:28 PM Received CLI ['heartbeat'] -11/18/2016 12:40:28 PM 0 Sending heartbeat -11/18/2016 12:40:28 PM heart beat received from: 0 ,sequence number: 2 -11/18/2016 12:40:29 PM Received CLI ['subscribe', '-t', 'hot', '-l', 'tosca.policies.Placement:properties:region:nova-1'] -11/18/2016 12:40:29 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-1'] and templates ['hot'] -11/18/2016 12:40:29 PM Subscribe Response is received from: 0 ,sequence number: 3 -11/18/2016 12:40:30 PM Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'OVERWRITE'] -11/18/2016 12:40:30 PM subscribing labels [] and templates ['dummy1', 'dummy2'] -11/18/2016 12:40:30 PM Subscribe Response is received from: 0 ,sequence number: 4 -11/18/2016 12:40:31 PM Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'DELETE'] -11/18/2016 12:40:31 PM subscribing labels [] and templates ['dummy1', 'dummy2'] -11/18/2016 12:40:31 PM Subscribe Response is received from: 0 ,sequence number: 5 -11/18/2016 12:40:32 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-2'] -11/18/2016 12:40:32 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-2'] and templates [] -11/18/2016 12:40:32 PM Subscribe Response is received from: 0 ,sequence number: 6 -11/18/2016 12:40:33 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'OVERWRITE'] -11/18/2016 12:40:33 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] -11/18/2016 12:40:33 PM Subscribe Response is received from: 0 ,sequence number: 7 -11/18/2016 12:40:34 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'DELETE'] -11/18/2016 12:40:34 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] -11/18/2016 12:40:34 PM Subscribe Response is received from: 0 ,sequence number: 8 -11/18/2016 12:40:35 PM Received CLI ['publish', '-t', './tosca-templates/tosca_helloworld_nfv.yaml'] -11/18/2016 12:40:35 PM Publishing the template file: ./tosca-templates/tosca_helloworld_nfv.yaml -11/18/2016 12:40:35 PM Publish Response is received from: 0 ,sequence number: 9 Status: 2 -11/18/2016 12:40:36 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement.Geolocation:properties:region:us-west-1'] -11/18/2016 12:40:36 PM subscribing labels ['tosca.policies.Placement.Geolocation:properties:region:us-west-1'] and templates [] -11/18/2016 12:40:36 PM Subscribe Response is received from: 0 ,sequence number: 10 -11/18/2016 12:40:37 PM 0 Received Template File +12/01/2016 12:06:19 PM Domino Client Starting... +12/01/2016 12:06:19 PM 1 Sending Registration +12/01/2016 12:06:19 PM Registration Response: Response Code: 1 +12/01/2016 12:06:19 PM CLI Service is starting +12/01/2016 12:06:19 PM RPC service for CLI is starting... +12/01/2016 12:06:21 PM Received CLI ['heartbeat'] +12/01/2016 12:06:21 PM 12345678123456781234567812345678 Sending heartbeat +12/01/2016 12:06:21 PM heart beat received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 2 +12/01/2016 12:06:22 PM Received CLI ['subscribe', '-t', 'hot', '-l', 'tosca.policies.Placement:properties:region:nova-1'] +12/01/2016 12:06:22 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-1'] and templates ['hot'] +12/01/2016 12:06:22 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 3 +12/01/2016 12:06:23 PM Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'OVERWRITE'] +12/01/2016 12:06:23 PM subscribing labels [] and templates ['dummy1', 'dummy2'] +12/01/2016 12:06:23 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 4 +12/01/2016 12:06:24 PM Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'DELETE'] +12/01/2016 12:06:24 PM subscribing labels [] and templates ['dummy1', 'dummy2'] +12/01/2016 12:06:24 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 5 +12/01/2016 12:06:25 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-2'] +12/01/2016 12:06:25 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-2'] and templates [] +12/01/2016 12:06:25 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 6 +12/01/2016 12:06:26 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'OVERWRITE'] +12/01/2016 12:06:26 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] +12/01/2016 12:06:26 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 7 +12/01/2016 12:06:27 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'DELETE'] +12/01/2016 12:06:27 PM subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] +12/01/2016 12:06:27 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 8 +12/01/2016 12:06:28 PM Received CLI ['publish', '-t', './tosca-templates/tosca_helloworld_nfv.yaml'] +12/01/2016 12:06:28 PM Publishing the template file: ./tosca-templates/tosca_helloworld_nfv.yaml +12/01/2016 12:06:28 PM Publish Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 9 Status: 2 +12/01/2016 12:06:29 PM Received CLI ['subscribe', '-l', 'tosca.policies.Placement.Geolocation:properties:region:us-west-1'] +12/01/2016 12:06:29 PM subscribing labels ['tosca.policies.Placement.Geolocation:properties:region:us-west-1'] and templates [] +12/01/2016 12:06:29 PM Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 10 +12/01/2016 12:06:30 PM 12345678123456781234567812345678 Received Template File diff --git a/tests/logdata/server.log b/tests/logdata/server.log index 1a7dbde..f50ed35 100644 --- a/tests/logdata/server.log +++ b/tests/logdata/server.log @@ -1,39 +1,39 @@ -11/18/2016 12:40:25 PM Domino Server Starting... -11/18/2016 12:40:26 PM Registration Request received for UDID 0 from IP: 172.16.42.3 port: 9091 -11/18/2016 12:40:27 PM Registration Request received for UDID 0 from IP: 172.16.42.3 port: 9092 -11/18/2016 12:40:28 PM heartbeat received from 0 -11/18/2016 12:40:29 PM Subscribe Request received from 0 -11/18/2016 12:40:29 PM APPENDING Labels... -11/18/2016 12:40:29 PM Supported Template: set(['hot']) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) -11/18/2016 12:40:30 PM Subscribe Request received from 0 -11/18/2016 12:40:30 PM APPENDING Labels... -11/18/2016 12:40:30 PM Supported Template: set(['dummy2', 'dummy1']) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) -11/18/2016 12:40:31 PM Subscribe Request received from 0 -11/18/2016 12:40:31 PM APPENDING Labels... -11/18/2016 12:40:31 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) -11/18/2016 12:40:32 PM Subscribe Request received from 0 -11/18/2016 12:40:32 PM APPENDING Labels... -11/18/2016 12:40:32 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-2', 'tosca.policies.Placement:properties:region:nova-1']) -11/18/2016 12:40:33 PM Subscribe Request received from 0 -11/18/2016 12:40:33 PM OVERWRITING Labels... -11/18/2016 12:40:33 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-3']) -11/18/2016 12:40:34 PM Subscribe Request received from 0 -11/18/2016 12:40:34 PM DELETING Labels... -11/18/2016 12:40:34 PM Supported Template: set([]) Supported Labels: set([]) -11/18/2016 12:40:35 PM Publish Request received from 0 -11/18/2016 12:40:35 PM ['tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0', '', 'description: Template for deploying a single server with predefined properties.', '', 'metadata:', ' template_name: TOSCA NFV Sample Template', '', 'policy_types:', ' tosca.policies.Placement.Geolocation:', ' description: Geolocation policy', ' derived_from: tosca.policies.Placement', '', 'topology_template:', ' node_templates:', ' VNF1:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf1', ' vendor: acmetelco', ' version: 1.0', '', ' VNF2:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf2', ' vendor: ericsson', ' version: 1.0', '', ' VNF3:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf3', ' vendor: huawei', ' version: 1.0', '', ' policies:', ' - rule1:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF1 ]', ' properties:', ' region: [ us-west-1 ]', ' - rule2:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF2, VNF3 ]', ' properties:', ' region: [ us-west-1 , us-west-2 ]'] -11/18/2016 12:40:35 PM Node Labels: {'VNF2': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF3': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF1': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1'])} -11/18/2016 12:40:35 PM Site Maps: {'VNF2': set([]), 'VNF3': set([]), 'VNF1': set([])} -11/18/2016 12:40:35 PM Selected Sites: {'VNF2': [], 'VNF3': [], 'VNF1': []} -11/18/2016 12:40:35 PM Per domain file paths: {} -11/18/2016 12:40:36 PM Subscribe Request received from 0 -11/18/2016 12:40:36 PM APPENDING Labels... -11/18/2016 12:40:36 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1']) -11/18/2016 12:40:37 PM Publish Request received from 1539113194358776833 -11/18/2016 12:40:37 PM ['tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0', '', 'description: Template for deploying a single server with predefined properties.', '', 'metadata:', ' template_name: TOSCA NFV Sample Template', '', 'policy_types:', ' tosca.policies.Placement.Geolocation:', ' description: Geolocation policy', ' derived_from: tosca.policies.Placement', '', 'topology_template:', ' node_templates:', ' VNF1:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf1', ' vendor: acmetelco', ' version: 1.0', '', ' VNF2:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf2', ' vendor: ericsson', ' version: 1.0', '', ' VNF3:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf3', ' vendor: huawei', ' version: 1.0', '', ' policies:', ' - rule1:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF1 ]', ' properties:', ' region: [ us-west-1 ]', ' - rule2:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF2, VNF3 ]', ' properties:', ' region: [ us-west-1 , us-west-2 ]'] -11/18/2016 12:40:37 PM ERRNO 17; ./toscafiles/ exists. Creating: ./toscafiles/template1.yaml -11/18/2016 12:40:37 PM Node Labels: {'VNF2': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF3': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF1': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1'])} -11/18/2016 12:40:37 PM Site Maps: {'VNF2': set([]), 'VNF3': set([]), 'VNF1': set([0])} -11/18/2016 12:40:37 PM Selected Sites: {'VNF2': [], 'VNF3': [], 'VNF1': 0} -11/18/2016 12:40:37 PM Per domain file paths: {0: './toscafiles/template_part0.yaml'} -11/18/2016 12:40:37 PM Push Response received from 0 +12/01/2016 12:06:18 PM Domino Server Starting... +12/01/2016 12:06:19 PM Registration Request received for UUID 12345678123456781234567812345678 from IP: 192.168.255.10 port: 9091 +12/01/2016 12:06:20 PM Registration Request received for UUID 12345678123456781234567812345678 from IP: 192.168.255.10 port: 9092 +12/01/2016 12:06:21 PM heartbeat received from 12345678123456781234567812345678 +12/01/2016 12:06:22 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:22 PM APPENDING Labels... +12/01/2016 12:06:22 PM Supported Template: set(['hot']) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) +12/01/2016 12:06:23 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:23 PM APPENDING Labels... +12/01/2016 12:06:23 PM Supported Template: set(['dummy2', 'dummy1']) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) +12/01/2016 12:06:24 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:24 PM APPENDING Labels... +12/01/2016 12:06:24 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-1']) +12/01/2016 12:06:25 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:25 PM APPENDING Labels... +12/01/2016 12:06:25 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-2', 'tosca.policies.Placement:properties:region:nova-1']) +12/01/2016 12:06:26 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:26 PM OVERWRITING Labels... +12/01/2016 12:06:26 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement:properties:region:nova-3']) +12/01/2016 12:06:27 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:27 PM DELETING Labels... +12/01/2016 12:06:27 PM Supported Template: set([]) Supported Labels: set([]) +12/01/2016 12:06:28 PM Publish Request received from 12345678123456781234567812345678 +12/01/2016 12:06:28 PM ['tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0', '', 'description: Template for deploying a single server with predefined properties.', '', 'metadata:', ' template_name: TOSCA NFV Sample Template', '', 'policy_types:', ' tosca.policies.Placement.Geolocation:', ' description: Geolocation policy', ' derived_from: tosca.policies.Placement', '', 'topology_template:', ' node_templates:', ' VNF1:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf1', ' vendor: acmetelco', ' version: 1.0', '', ' VNF2:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf2', ' vendor: ericsson', ' version: 1.0', '', ' VNF3:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf3', ' vendor: huawei', ' version: 1.0', '', ' policies:', ' - rule1:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF1 ]', ' properties:', ' region: [ us-west-1 ]', ' - rule2:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF2, VNF3 ]', ' properties:', ' region: [ us-west-1 , us-west-2 ]'] +12/01/2016 12:06:28 PM Node Labels: {'VNF2': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF3': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF1': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1'])} +12/01/2016 12:06:28 PM Site Maps: {'VNF2': set([]), 'VNF3': set([]), 'VNF1': set([])} +12/01/2016 12:06:28 PM Selected Sites: {'VNF2': [], 'VNF3': [], 'VNF1': []} +12/01/2016 12:06:28 PM Per domain file paths: {} +12/01/2016 12:06:29 PM Subscribe Request received from 12345678123456781234567812345678 +12/01/2016 12:06:29 PM APPENDING Labels... +12/01/2016 12:06:29 PM Supported Template: set([]) Supported Labels: set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1']) +12/01/2016 12:06:30 PM Publish Request received from 35bf10e4d2524653bf88d6cf0a184f1b +12/01/2016 12:06:30 PM ['tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0', '', 'description: Template for deploying a single server with predefined properties.', '', 'metadata:', ' template_name: TOSCA NFV Sample Template', '', 'policy_types:', ' tosca.policies.Placement.Geolocation:', ' description: Geolocation policy', ' derived_from: tosca.policies.Placement', '', 'topology_template:', ' node_templates:', ' VNF1:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf1', ' vendor: acmetelco', ' version: 1.0', '', ' VNF2:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf2', ' vendor: ericsson', ' version: 1.0', '', ' VNF3:', ' type: tosca.nodes.nfv.VNF', ' properties:', ' id: vnf3', ' vendor: huawei', ' version: 1.0', '', ' policies:', ' - rule1:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF1 ]', ' properties:', ' region: [ us-west-1 ]', ' - rule2:', ' type: tosca.policies.Placement.Geolocation', ' targets: [ VNF2, VNF3 ]', ' properties:', ' region: [ us-west-1 , us-west-2 ]'] +12/01/2016 12:06:30 PM ERRNO 17; ./toscafiles/ exists. Creating: ./toscafiles/template1.yaml +12/01/2016 12:06:30 PM Node Labels: {'VNF2': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF3': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1', 'tosca.policies.Placement.Geolocation:properties:region:us-west-2']), 'VNF1': set(['tosca.policies.Placement.Geolocation:properties:region:us-west-1'])} +12/01/2016 12:06:30 PM Site Maps: {'VNF2': set([]), 'VNF3': set([]), 'VNF1': set(['12345678123456781234567812345678'])} +12/01/2016 12:06:30 PM Selected Sites: {'VNF2': [], 'VNF3': [], 'VNF1': '12345678123456781234567812345678'} +12/01/2016 12:06:30 PM Per domain file paths: {'12345678123456781234567812345678': './toscafiles/template_part12345678123456781234567812345678.yaml'} +12/01/2016 12:06:30 PM Push Response received from 12345678123456781234567812345678 diff --git a/tests/refdata/test1_client1.ref b/tests/refdata/test1_client1.ref index 0d6714d..b1a0d49 100644 --- a/tests/refdata/test1_client1.ref +++ b/tests/refdata/test1_client1.ref @@ -4,30 +4,30 @@ Registration Response: Response Code: 1 CLI Service is starting RPC service for CLI is starting... Received CLI ['heartbeat'] -0 Sending heartbeat -heart beat received from: 0 ,sequence number: 2 +12345678123456781234567812345678 Sending heartbeat +heart beat received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 2 Received CLI ['subscribe', '-t', 'hot', '-l', 'tosca.policies.Placement:properties:region:nova-1'] subscribing labels ['tosca.policies.Placement:properties:region:nova-1'] and templates ['hot'] -Subscribe Response is received from: 0 ,sequence number: 3 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 3 Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'OVERWRITE'] subscribing labels [] and templates ['dummy1', 'dummy2'] -Subscribe Response is received from: 0 ,sequence number: 4 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 4 Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'DELETE'] subscribing labels [] and templates ['dummy1', 'dummy2'] -Subscribe Response is received from: 0 ,sequence number: 5 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 5 Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-2'] subscribing labels ['tosca.policies.Placement:properties:region:nova-2'] and templates [] -Subscribe Response is received from: 0 ,sequence number: 6 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 6 Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'OVERWRITE'] subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] -Subscribe Response is received from: 0 ,sequence number: 7 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 7 Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'DELETE'] subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] -Subscribe Response is received from: 0 ,sequence number: 8 +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 8 Received CLI ['publish', '-t', './tosca-templates/tosca_helloworld_nfv.yaml'] Publishing the template file: ./tosca-templates/tosca_helloworld_nfv.yaml -Publish Response is received from: 0 ,sequence number: 9 Status: 2 +Publish Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 9 Status: 2 Received CLI ['subscribe', '-l', 'tosca.policies.Placement.Geolocation:properties:region:us-west-1'] subscribing labels ['tosca.policies.Placement.Geolocation:properties:region:us-west-1'] and templates [] -Subscribe Response is received from: 0 ,sequence number: 10 -0 Received Template File +Subscribe Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 10 +12345678123456781234567812345678 Received Template File diff --git a/tests/refdata/test1_client2.ref b/tests/refdata/test1_client2.ref index 7c4fd56..b533bd3 100644 --- a/tests/refdata/test1_client2.ref +++ b/tests/refdata/test1_client2.ref @@ -5,4 +5,4 @@ CLI Service is starting RPC service for CLI is starting... Received CLI ['publish', '-t', './tosca-templates/tosca_helloworld_nfv.yaml'] Publishing the template file: ./tosca-templates/tosca_helloworld_nfv.yaml -Publish Response is received from: 0 ,sequence number: 11 Status: 1 +Publish Response is received from: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ,sequence number: 11 Status: 1 -- cgit 1.2.3-korg