aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-11-25 11:39:03 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2019-12-06 10:22:10 +0000
commit4cc691d7bbf275798211d08e1bc41672c15ad7d3 (patch)
tree37b65ba87876b8dc58b69c45f6cb3b58a832bc85 /test
parentba8a72f9ac68fbdf04f9470960fae496aa49fa71 (diff)
Insert SDNC ip pool automatically only if oom_mode is enabled
Change-Id: Ia1fe923f877cf76e51bcc1f23c9bf562a877b112 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com> Issue-ID: TEST-222
Diffstat (limited to 'test')
-rwxr-xr-xtest/vcpe/config_sdnc_so.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/vcpe/config_sdnc_so.py b/test/vcpe/config_sdnc_so.py
index 375c7aaff..9f9a2e007 100755
--- a/test/vcpe/config_sdnc_so.py
+++ b/test/vcpe/config_sdnc_so.py
@@ -88,14 +88,18 @@ def insert_customer_service_to_so(vcpecommon):
vcpecommon.onap_environment) + '\n'.join(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 IGNORE INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';')
- vcpecommon.execute_cmds_mariadb(cmds)
+ if vcpecommon.oom_mode:
+ 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 IGNORE INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';')
+ vcpecommon.execute_cmds_mariadb(cmds)
+ else:
+ # Ip pool should have been inserted manually according to the documentation
+ pass