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 :
@@ -141,6 +144,7 @@ def callConfig(self, key, lpar=""):
141
144
if key == "cec" :
142
145
lmb_size = None
143
146
num_hugepages = None
147
+ ioenlargecapacity = None
144
148
setup = 0
145
149
if not self .cv_HMC .lpar_vios :
146
150
self .skipTest ("Please pass lpar_vios in config file." )
@@ -159,10 +163,16 @@ def callConfig(self, key, lpar=""):
159
163
num_hugepages = re .findall (
160
164
'hugepages=[0-9]+' ,
161
165
str (self .machine_config ))[0 ].split ('=' )[1 ]
166
+ if "iocapacity" in config_value :
167
+ setup = 1
168
+ if self .bmc_type in ["EBMC_PHYP" , "FSP_PHYP" ]:
169
+ ioenlargecapacity = re .findall (
170
+ 'iocapacity=[0-9]+' , str (self .machine_config ))[0 ].split ('=' )[1 ]
162
171
163
172
status = CecConfig (self .cv_HMC , self .system_name , self .lpar_name ,
164
173
self .lpar_prof , lmb = lmb_size ,
165
- hugepages = num_hugepages ).CecSetup ()
174
+ hugepages = num_hugepages , iocapacity = ioenlargecapacity ,
175
+ bmc_type = self .bmc_type , bmc = self .cv_SYSTEM .bmc ).CecSetup ()
166
176
if status :
167
177
self .fail (status )
168
178
if not setup :
@@ -469,7 +479,8 @@ class CecConfig():
469
479
'''
470
480
471
481
def __init__ (self , cv_HMC = None , system_name = None ,
472
- lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ):
482
+ lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ,
483
+ iocapacity = None , bmc_type = None , bmc = None ):
473
484
474
485
self .cv_HMC = cv_HMC
475
486
self .system_name = system_name
@@ -478,7 +489,13 @@ def __init__(self, cv_HMC=None, system_name=None,
478
489
self .lmb_size = lmb
479
490
self .num_hugepages = hugepages
480
491
self .setup = 0
481
- self .cec_dict = {'lmb_cec' : None , 'hugepages' : None }
492
+ self .iocapacity = iocapacity
493
+ self .cec_dict = {'lmb_cec' : None , 'hugepages' : None , 'iocapacity' : None }
494
+ self .config = OpTestConfiguration .conf
495
+ self .bmc_type = bmc_type
496
+ self .bmc = bmc
497
+ if self .bmc_type == "FSP_PHYP" and iocapacity is not None :
498
+ self .bmc .cv_ASM .configure_enlarged_io (iocapacity )
482
499
483
500
def CecSetup (self ):
484
501
@@ -489,6 +506,11 @@ def CecSetup(self):
489
506
self .lmb_setup ()
490
507
if self .cec_dict ['hugepages' ] is not None :
491
508
self .hugepage_16gb_setup ()
509
+ if self .cec_dict ['iocapacity' ] is not None :
510
+ if bmc_type == "EBMC_PHYP" :
511
+ self .io_enlarge_cpacity ()
512
+ elif bmc_type == "FSP_PHYP" :
513
+ self .cv_ASM .configure_enlarged_io (self .iocapacity )
492
514
if self .setup :
493
515
self .cv_HMC .poweron_system ()
494
516
self .ValidateCEC_Setup ()
@@ -514,6 +536,11 @@ def ValidateCEC_Setup(self):
514
536
self .setting_16gb_hugepage_profile ()
515
537
else :
516
538
self .cec_dict ['hugepages' ] = self .num_hugepages
539
+ if self .iocapacity :
540
+ if self .bmc_type == "FSP_PHYP" :
541
+ self .bmc .cv_ASM .configure_enlarged_io (self .iocapacity )
542
+ else :
543
+ self .io_enlarge_capacity ()
517
544
518
545
def lmb_setup (self ):
519
546
# Configure the lmb as per user request
@@ -531,6 +558,37 @@ def setting_16gb_hugepage_profile(self):
531
558
int (self .current_hgpg [0 ]))
532
559
self .cv_HMC .set_lpar_cfg (attrs )
533
560
561
+ def io_enlarge_capacity (self ):
562
+ """
563
+ Calling set IO Enlarge capacity if provided value is not same as current value
564
+ """
565
+ cur_iocapacity = self .get_current_ioadapter_enlarged_capacity ()
566
+ log .info ("Setting up ioenlarge capacity" )
567
+ log .info ("Current ioenlarge capacity value:" + str (cur_iocapacity ))
568
+ if cur_iocapacity != self .iocapacity :
569
+ self .set_ioenlarge_capacity ()
570
+ else :
571
+ log .info ("Provided IO Enlarge capacity value is same as current value, Exiting..." )
572
+
573
+ def get_current_ioadapter_enlarged_capacity (self ):
574
+ """
575
+ Get ioadapter enlarged capcity value
576
+ """
577
+ log .debug ("=====Get current IOAdapter Enlarge Capacity=====" )
578
+ return self .bmc .rest_api .get_bios_attribute_value (
579
+ bios_attribute = "hb_ioadapter_enlarged_capacity_current"
580
+ )
581
+
582
+ def set_ioenlarge_capacity (self ):
583
+ """
584
+ Set ioadapter enlarged capcity value
585
+ """
586
+ log .debug ("=====Set IOAdapter Enlarge Capacity=====" )
587
+ self .bmc .rest_api .set_bios_attribute (
588
+ bios_attribute = "hb_ioadapter_enlarged_capacity" ,
589
+ bios_attribute_val = self .iocapacity
590
+ )
591
+
534
592
535
593
class OsConfig ():
536
594
'''
0 commit comments