@@ -299,6 +299,8 @@ def get_unsupported_lower_protocol():
299299 This is used to determine the lowest protocol version that is NOT
300300 supported by the version of C* running
301301 """
302+ if SCYLLA_VERSION is not None :
303+ return 2
302304 if CASSANDRA_VERSION >= Version ('3.0' ):
303305 return 2
304306 else :
@@ -310,6 +312,8 @@ def get_unsupported_upper_protocol():
310312 This is used to determine the highest protocol version that is NOT
311313 supported by the version of C* running
312314 """
315+ if SCYLLA_VERSION is not None :
316+ return 5
313317
314318 if CASSANDRA_VERSION >= Version ('4.0-a' ):
315319 if DSE_VERSION :
@@ -819,6 +823,38 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None, port=9042):
819823 cluster .shutdown ()
820824
821825
826+ def is_scylla_enterprise (version : Version ) -> bool :
827+ return version > Version ('2000.1.1' )
828+
829+
830+ def xfail_scylla_version_lt (reason , oss_scylla_version , ent_scylla_version , * args , ** kwargs ):
831+ """
832+ It is used to mark tests that are going to fail on certain scylla versions.
833+ :param reason: message to fail test with
834+ :param oss_scylla_version: str, oss version from which test supposed to succeed
835+ :param ent_scylla_version: str, enterprise version from which test supposed to succeed. It should end with `.1.1`
836+ """
837+ if not reason .startswith ("scylladb/scylladb#" ):
838+ raise ValueError ('reason should start with scylladb/scylladb#<issue-id> to reference issue in scylla repo' )
839+
840+ if not isinstance (ent_scylla_version , str ):
841+ raise ValueError ('ent_scylla_version should be a str' )
842+
843+ if not ent_scylla_version .endswith ("1.1" ):
844+ raise ValueError ('ent_scylla_version should end with "1.1"' )
845+
846+ if SCYLLA_VERSION is None :
847+ return pytest .mark .skipif (False , reason = "It is just a NoOP Decor, should not skip anything" )
848+
849+ current_version = Version (get_scylla_version (SCYLLA_VERSION ))
850+
851+ if is_scylla_enterprise (current_version ):
852+ return pytest .mark .xfail (current_version < Version (ent_scylla_version ),
853+ reason = reason , * args , ** kwargs )
854+
855+ return pytest .mark .xfail (current_version < Version (oss_scylla_version ), reason = reason , * args , ** kwargs )
856+
857+
822858class UpDownWaiter (object ):
823859
824860 def __init__ (self , host ):
0 commit comments