33
33
34
34
import OpTestConfiguration
35
35
import OpTestLogger
36
+ from common import OpTestASM
36
37
from common import OpTestHMC
37
38
from common import OpTestInstallUtil
39
+ from common .OpTestEBMC import EBMCHostManagement
38
40
from common .OpTestUtil import OpTestUtil
39
41
from common .OpTestSystem import OpSystemState
40
42
@@ -140,6 +142,7 @@ def callConfig(self, key, lpar=""):
140
142
if key == "cec" :
141
143
lmb_size = None
142
144
num_hugepages = None
145
+ ioenlargecapacity = None
143
146
setup = 0
144
147
if not self .cv_HMC .lpar_vios :
145
148
self .skipTest ("Please pass lpar_vios in config file." )
@@ -158,10 +161,15 @@ def callConfig(self, key, lpar=""):
158
161
num_hugepages = re .findall (
159
162
'hugepages=[0-9]+' ,
160
163
str (self .machine_config ))[0 ].split ('=' )[1 ]
164
+ if "iocapacity" in config_value :
165
+ setup = 1
166
+ if self .bmc_type == "EBMC_PHYP" :
167
+ ioenlargecapacity = re .findall (
168
+ 'iocapacity=[0-9]+' , str (self .machine_config ))[0 ].split ('=' )[1 ]
161
169
162
170
status = CecConfig (self .cv_HMC , self .system_name , self .lpar_name ,
163
171
self .lpar_prof , lmb = lmb_size ,
164
- hugepages = num_hugepages ).CecSetup ()
172
+ hugepages = num_hugepages , iocapacity = ioenlargecapacity ).CecSetup ()
165
173
if status :
166
174
self .fail (status )
167
175
if not setup :
@@ -474,7 +482,8 @@ class CecConfig():
474
482
'''
475
483
476
484
def __init__ (self , cv_HMC = None , system_name = None ,
477
- lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ):
485
+ lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ,
486
+ iocapacity = None ):
478
487
479
488
self .cv_HMC = cv_HMC
480
489
self .system_name = system_name
@@ -483,7 +492,13 @@ def __init__(self, cv_HMC=None, system_name=None,
483
492
self .lmb_size = lmb
484
493
self .num_hugepages = hugepages
485
494
self .setup = 0
486
- self .cec_dict = {'lmb_cec' : None , 'hugepages' : None }
495
+ self .iocapacity = iocapacity
496
+ self .cec_dict = {'lmb_cec' : None , 'hugepages' : None , 'iocapacity' : None }
497
+ self .config = OpTestConfiguration .conf
498
+ self .BMCHostMgmt = EBMCHostManagement (conf = self .config ,
499
+ ip = self .config .args .bmc_ip ,
500
+ username = self .config .args .bmc_username ,
501
+ password = self .config .args .bmc_password )
487
502
488
503
def CecSetup (self ):
489
504
@@ -494,6 +509,8 @@ def CecSetup(self):
494
509
self .lmb_setup ()
495
510
if self .cec_dict ['hugepages' ] is not None :
496
511
self .hugepage_16gb_setup ()
512
+ if self .cec_dict ['iocapacity' ] is not None :
513
+ self .io_enlarge_cpacity ()
497
514
if self .setup :
498
515
self .cv_HMC .poweron_system ()
499
516
self .ValidateCEC_Setup ()
@@ -519,6 +536,8 @@ def ValidateCEC_Setup(self):
519
536
self .setting_16gb_hugepage_profile ()
520
537
else :
521
538
self .cec_dict ['hugepages' ] = self .num_hugepages
539
+ if self .iocapacity :
540
+ self .io_enlarge_capacity ()
522
541
523
542
def lmb_setup (self ):
524
543
# Configure the lmb as per user request
@@ -536,6 +555,37 @@ def setting_16gb_hugepage_profile(self):
536
555
int (self .current_hgpg [0 ]))
537
556
self .cv_HMC .set_lpar_cfg (attrs )
538
557
558
+ def io_enlarge_capacity (self ):
559
+ """
560
+ Calling set IO Enlarge capacity if provided value is not same as current value
561
+ """
562
+ cur_iocapacity = self .get_current_ioadapter_enlarged_capacity ()
563
+ log .info ("Setting up ioenlarge capacity" )
564
+ log .info ("Current ioenlarge capacity value:" + str (cur_iocapacity ))
565
+ if cur_iocapacity != self .iocapacity :
566
+ self .set_ioenlarge_capacity ()
567
+ else :
568
+ log .info ("Provided IO Enlarge capacity value is same as current value, Exiting..." )
569
+
570
+ def get_current_ioadapter_enlarged_capacity (self ):
571
+ """
572
+ Get ioadapter enlarged capcity value
573
+ """
574
+ log .debug ("=====Get current IOAdapter Enlarge Capacity=====" )
575
+ return self .BMCHostMgmt .get_bios_attribute_value (
576
+ bios_attribute = "hb_ioadapter_enlarged_capacity_current"
577
+ )
578
+
579
+ def set_ioenlarge_capacity (self ):
580
+ """
581
+ Set ioadapter enlarged capcity value
582
+ """
583
+ log .debug ("=====Set IOAdapter Enlarge Capacity=====" )
584
+ self .BMCHostMgmt .set_bios_attribute (
585
+ bios_attribute = "hb_ioadapter_enlarged_capacity" ,
586
+ bios_attribute_val = self .iocapacity
587
+ )
588
+
539
589
540
590
class OsConfig ():
541
591
'''
0 commit comments