@@ -108,14 +108,26 @@ def storage_pool_name(provisioning_type: str) -> str:
108108def provisioning_type (request : pytest .FixtureRequest ) -> str :
109109 return request .param
110110
111+ def pytest_configure (config ):
112+ config ._linstor_upgrade_test = False
113+
114+ def pytest_collection_modifyitems (config , items ):
115+ for item in items :
116+ if item .get_closest_marker ("upgrade_test" ):
117+ config ._linstor_upgrade_test = True
118+ break
119+
111120@pytest .fixture (scope = 'package' )
112121def pool_with_linstor (
113122 hostA2 : Host ,
114123 lvm_disks : None ,
115124 pool_with_saved_yum_state : Pool ,
116- _linstor_config : LinstorConfig
125+ _linstor_config : LinstorConfig ,
126+ request
117127) -> Generator [Pool , None , None ]:
118128 import concurrent .futures
129+
130+ dont_use_testing_repo = request .config ._linstor_upgrade_test
119131 pool = pool_with_saved_yum_state
120132
121133 def ensure_linstor_not_installed (host : Host ) -> None :
@@ -130,7 +142,10 @@ def ensure_linstor_not_installed(host: Host) -> None:
130142 def install_linstor (host : Host ) -> None :
131143 logging .info (f"Installing { LINSTOR_PACKAGE } on host { host } ..." )
132144 host .yum_install ([LINSTOR_RELEASE_PACKAGE ])
133- host .yum_install ([LINSTOR_PACKAGE ], enablerepo = "xcp-ng-linstor-testing" )
145+ if dont_use_testing_repo :
146+ host .yum_install ([LINSTOR_PACKAGE ])
147+ else :
148+ host .yum_install ([LINSTOR_PACKAGE ], enablerepo = "xcp-ng-linstor-testing" )
134149 # Needed because the linstor driver is not in the xapi sm-plugins list
135150 # before installing the LINSTOR packages.
136151 host .ssh ('systemctl restart multipathd' )
0 commit comments