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
@@ -59,6 +61,7 @@ def setUp(self):
59
61
self .lpar_prof = conf .args .lpar_prof
60
62
self .util = OpTestUtil (conf )
61
63
self .lpar_flag = False
64
+ self .cv_BMC = self .cv_SYSTEM .bmc
62
65
try :
63
66
self .lpar_list = conf .args .lpar_list
64
67
except AttributeError :
@@ -140,6 +143,7 @@ def callConfig(self, key, lpar=""):
140
143
if key == "cec" :
141
144
lmb_size = None
142
145
num_hugepages = None
146
+ ioenlargecapacity = None
143
147
setup = 0
144
148
if not self .cv_HMC .lpar_vios :
145
149
self .skipTest ("Please pass lpar_vios in config file." )
@@ -158,10 +162,16 @@ def callConfig(self, key, lpar=""):
158
162
num_hugepages = re .findall (
159
163
'hugepages=[0-9]+' ,
160
164
str (self .machine_config ))[0 ].split ('=' )[1 ]
165
+ if "iocapacity" in config_value :
166
+ setup = 1
167
+ if self .bmc_type in ["EBMC_PHYP" , "FSP_PHYP" ]:
168
+ ioenlargecapacity = re .findall (
169
+ 'iocapacity=[0-9]+' , str (self .machine_config ))[0 ].split ('=' )[1 ]
161
170
162
171
status = CecConfig (self .cv_HMC , self .system_name , self .lpar_name ,
163
172
self .lpar_prof , lmb = lmb_size ,
164
- hugepages = num_hugepages ).CecSetup ()
173
+ hugepages = num_hugepages , iocapacity = ioenlargecapacity ,
174
+ bmc_type = self .bmc_type , bmc = self .cv_SYSTEM .bmc ).CecSetup ()
165
175
if status :
166
176
self .fail (status )
167
177
if not setup :
@@ -474,7 +484,8 @@ class CecConfig():
474
484
'''
475
485
476
486
def __init__ (self , cv_HMC = None , system_name = None ,
477
- lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ):
487
+ lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ,
488
+ iocapacity = None , bmc_type = None , bmc = None ):
478
489
479
490
self .cv_HMC = cv_HMC
480
491
self .system_name = system_name
@@ -483,7 +494,13 @@ def __init__(self, cv_HMC=None, system_name=None,
483
494
self .lmb_size = lmb
484
495
self .num_hugepages = hugepages
485
496
self .setup = 0
486
- self .cec_dict = {'lmb_cec' : None , 'hugepages' : None }
497
+ self .iocapacity = iocapacity
498
+ self .cec_dict = {'lmb_cec' : None , 'hugepages' : None , 'iocapacity' : None }
499
+ self .config = OpTestConfiguration .conf
500
+ self .bmc_type = bmc_type
501
+ self .bmc = bmc
502
+ if self .bmc_type == "FSP_PHYP" and iocapacity is not None :
503
+ self .bmc .cv_ASM .configure_enlarged_io (iocapacity )
487
504
488
505
def CecSetup (self ):
489
506
@@ -494,6 +511,11 @@ def CecSetup(self):
494
511
self .lmb_setup ()
495
512
if self .cec_dict ['hugepages' ] is not None :
496
513
self .hugepage_16gb_setup ()
514
+ if self .cec_dict ['iocapacity' ] is not None :
515
+ if bmc_type == "EBMC_PHYP" :
516
+ self .io_enlarge_cpacity ()
517
+ elif bmc_type == "FSP_PHYP" :
518
+ self .cv_ASM .configure_enlarged_io (self .iocapacity )
497
519
if self .setup :
498
520
self .cv_HMC .poweron_system ()
499
521
self .ValidateCEC_Setup ()
@@ -519,6 +541,11 @@ def ValidateCEC_Setup(self):
519
541
self .setting_16gb_hugepage_profile ()
520
542
else :
521
543
self .cec_dict ['hugepages' ] = self .num_hugepages
544
+ if self .iocapacity :
545
+ if self .bmc_type == "FSP_PHYP" :
546
+ self .bmc .cv_ASM .configure_enlarged_io (self .iocapacity )
547
+ else :
548
+ self .io_enlarge_capacity ()
522
549
523
550
def lmb_setup (self ):
524
551
# Configure the lmb as per user request
@@ -536,6 +563,37 @@ def setting_16gb_hugepage_profile(self):
536
563
int (self .current_hgpg [0 ]))
537
564
self .cv_HMC .set_lpar_cfg (attrs )
538
565
566
+ def io_enlarge_capacity (self ):
567
+ """
568
+ Calling set IO Enlarge capacity if provided value is not same as current value
569
+ """
570
+ cur_iocapacity = self .get_current_ioadapter_enlarged_capacity ()
571
+ log .info ("Setting up ioenlarge capacity" )
572
+ log .info ("Current ioenlarge capacity value:" + str (cur_iocapacity ))
573
+ if cur_iocapacity != self .iocapacity :
574
+ self .set_ioenlarge_capacity ()
575
+ else :
576
+ log .info ("Provided IO Enlarge capacity value is same as current value, Exiting..." )
577
+
578
+ def get_current_ioadapter_enlarged_capacity (self ):
579
+ """
580
+ Get ioadapter enlarged capcity value
581
+ """
582
+ log .debug ("=====Get current IOAdapter Enlarge Capacity=====" )
583
+ return self .bmc .rest_api .get_bios_attribute_value (
584
+ bios_attribute = "hb_ioadapter_enlarged_capacity_current"
585
+ )
586
+
587
+ def set_ioenlarge_capacity (self ):
588
+ """
589
+ Set ioadapter enlarged capcity value
590
+ """
591
+ log .debug ("=====Set IOAdapter Enlarge Capacity=====" )
592
+ self .bmc .rest_api .set_bios_attribute (
593
+ bios_attribute = "hb_ioadapter_enlarged_capacity" ,
594
+ bios_attribute_val = self .iocapacity
595
+ )
596
+
539
597
540
598
class OsConfig ():
541
599
'''
0 commit comments