aboutsummaryrefslogtreecommitdiffstats
path: root/test/vcpe/config_sdnc_so.py
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-10-16 15:28:23 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-10-16 15:28:23 +0200
commit9018a8458ca5cd3a39c9f2b6fb7eab8bc9284ac9 (patch)
treedc75b6c79d884d68093bc64fb7e48212753798ba /test/vcpe/config_sdnc_so.py
parentf2d8bca52e0ff36f3b114bc557e9b88c8aad6098 (diff)
Automate SDNC ip pool insertion into database
This patch automates SDNC ip pool generation in sdnctl database in the scope of vcpe.py 'init' stage. Change-Id: I6322ff2dadb069991be0eddbb0cf415baa7984f6 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com> Issue-ID: TEST-222
Diffstat (limited to 'test/vcpe/config_sdnc_so.py')
-rwxr-xr-xtest/vcpe/config_sdnc_so.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/vcpe/config_sdnc_so.py b/test/vcpe/config_sdnc_so.py
index 46d4c1c4c..13ac47bee 100755
--- a/test/vcpe/config_sdnc_so.py
+++ b/test/vcpe/config_sdnc_so.py
@@ -81,3 +81,16 @@ def insert_customer_service_to_so(vcpecommon):
'Please manually run the following sql command in SO catalogdb database to insert customer service recipe')
logger.info('\n'.join(cmds))
#vcpecommon.execute_cmds_so_db(cmds)
+
+def insert_sdnc_ip_pool(vcpecommon):
+ logger = logging.getLogger(__name__)
+ logger.info('Inserting SDNC ip pool to SDNC DB')
+ cmds = []
+ # Get the VGWs network address
+ vgw_net = '.'.join(vcpecommon.preload_network_config['mux_gw'][0].split('.')[:3])
+ row_values = []
+ # Prepare single INSERT statement with all IP values
+ for ip in range(22,250):
+ row_values.append("('', 'VGW', 'AVAILABLE','{0}.{1}')".format(vgw_net,ip))
+ cmds.append("INSERT INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';')
+ vcpecommon.execute_cmds_mariadb(cmds)