@@ -299,6 +299,8 @@ def get_unsupported_lower_protocol():
299
299
This is used to determine the lowest protocol version that is NOT
300
300
supported by the version of C* running
301
301
"""
302
+ if SCYLLA_VERSION is not None :
303
+ return 2
302
304
if CASSANDRA_VERSION >= Version ('3.0' ):
303
305
return 2
304
306
else :
@@ -310,6 +312,8 @@ def get_unsupported_upper_protocol():
310
312
This is used to determine the highest protocol version that is NOT
311
313
supported by the version of C* running
312
314
"""
315
+ if SCYLLA_VERSION is not None :
316
+ return 5
313
317
314
318
if CASSANDRA_VERSION >= Version ('4.0-a' ):
315
319
if DSE_VERSION :
@@ -819,6 +823,38 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None, port=9042):
819
823
cluster .shutdown ()
820
824
821
825
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
+
822
858
class UpDownWaiter (object ):
823
859
824
860
def __init__ (self , host ):
0 commit comments