From cd82c1989605219312ee48e49b873d9eb5f8cd36 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:31:02 -0700 Subject: [PATCH] Skip tests that use bin info command when running against server 7.0+ --- test/new_tests/test_info_all.py | 4 ++++ test/new_tests/test_info_random_node.py | 10 ++++++++-- test/new_tests/test_info_single_node.py | 11 +++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/test/new_tests/test_info_all.py b/test/new_tests/test_info_all.py index 3681c5be3..1530ec502 100644 --- a/test/new_tests/test_info_all.py +++ b/test/new_tests/test_info_all.py @@ -3,6 +3,7 @@ import pytest from aerospike import exception as e +from .test_base_class import TestBaseClass import aerospike @@ -35,6 +36,9 @@ def test_positive_info_all(self, container_type, container_name): Test to see whether a namespace, set, and bin exist after a key is added """ + if container_type == "bins" and (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 0): + pytest.skip("\"bins\" info command has been removed in server 7.0") + key = ("test", "demo", "list_key") rec = {"names": ["John", "Marlen", "Steve"]} diff --git a/test/new_tests/test_info_random_node.py b/test/new_tests/test_info_random_node.py index d443fb66b..acf51c921 100644 --- a/test/new_tests/test_info_random_node.py +++ b/test/new_tests/test_info_random_node.py @@ -29,6 +29,9 @@ def test_info_random_node_positive(self): """ if self.pytest_skip: pytest.xfail() + if (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 0): + pytest.skip("\"bins\" info command has been removed in server 7.0") + response = self.as_connection.info_random_node("bins") assert "names" in response @@ -81,9 +84,9 @@ def test_info_random_node_positive_with_correct_policy(self): if self.pytest_skip: pytest.xfail() policy = {"timeout": 180000} - response = self.as_connection.info_random_node("bins", policy=policy) + response = self.as_connection.info_random_node("sets", policy=policy) - assert "names" in response + assert "demo" in response def test_info_random_node_positive_with_host(self): """ @@ -91,6 +94,9 @@ def test_info_random_node_positive_with_host(self): """ if self.pytest_skip: pytest.xfail() + if (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 0): + pytest.skip("\"bins\" info command has been removed in server 7.0") + response = self.as_connection.info_random_node("bins") assert "names" in response diff --git a/test/new_tests/test_info_single_node.py b/test/new_tests/test_info_single_node.py index 971b5dae7..825974932 100644 --- a/test/new_tests/test_info_single_node.py +++ b/test/new_tests/test_info_single_node.py @@ -30,6 +30,9 @@ def test_info_single_node_positive(self): """ if self.pytest_skip: pytest.xfail() + if (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 0): + pytest.skip("\"bins\" info command has been removed in server 7.0") + response = self.as_connection.info_single_node("bins", self.host_name) # This should probably make sure that a bin is actually named 'names' @@ -84,9 +87,9 @@ def test_info_single_node_positive_with_correct_policy(self): pytest.xfail() host = self.host_name policy = {"timeout": 180000} - response = self.as_connection.info_single_node("bins", host, policy) + response = self.as_connection.info_single_node("namespaces", host, policy) - assert "names" in response + assert "test" in response def test_info_single_node_positive_with_host(self): """ @@ -95,9 +98,9 @@ def test_info_single_node_positive_with_host(self): if self.pytest_skip: pytest.xfail() host = self.host_name - response = self.as_connection.info_single_node("bins", host) + response = self.as_connection.info_single_node("namespaces", host) - assert "names" in response + assert "test" in response def test_info_single_node_positive_with_all_parameters(self): """