Skip to content

Commit

Permalink
tests: add CloudSelfTest
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhsu committed May 26, 2023
1 parent 1d2a8f7 commit d64235b
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tests/rptest/tests/services_self_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# by the Apache License, Version 2.0

from ducktape.mark import matrix
from ducktape.tests.test import Test

from rptest.tests.redpanda_test import RedpandaTest
from rptest.services.cluster import cluster
Expand All @@ -16,7 +17,7 @@
from rptest.services.openmessaging_benchmark import OpenMessagingBenchmark
from rptest.services.kgo_repeater_service import repeater_traffic
from rptest.services.kgo_verifier_services import KgoVerifierRandomConsumer, KgoVerifierSeqConsumer, KgoVerifierConsumerGroupConsumer, KgoVerifierProducer
from rptest.services.redpanda import SISettings, CloudStorageType, get_cloud_storage_type
from rptest.services.redpanda import SISettings, CloudStorageType, get_cloud_storage_type, make_redpanda_service
from rptest.tests.prealloc_nodes import PreallocNodesTest
from rptest.utils.si_utils import BucketView
from rptest.util import expect_exception
Expand Down Expand Up @@ -230,3 +231,31 @@ def all_partitions_have_segments():
self.redpanda.nodes,
lambda n: self.redpanda.start_node(n, first_start=False),
parallel=True)


class CloudSelfTest(Test):
"""
Verify redpanda cloud can be used in ducktape tests.
Exercises the factory function as a drop-in replacement for RedpandaService.
"""
def __init__(self, test_context):
super(CloudSelfTest, self).__init__(test_context)
self.redpanda = make_redpanda_service(test_context, 3)

def setUp(self):
self.redpanda.start()

@cluster(num_nodes=1, check_allowed_error_logs=False)
def test_cloud(self):
"""
Execute a few of the methods that will connect to the k8s pod.
"""

node_memory = float(self.redpanda.get_node_memory_mb())
assert node_memory > 1.0

node_cpu_count = self.redpanda.get_node_cpu_count()
assert node_cpu_count > 0

node_disk_free = self.redpanda.get_node_disk_free()
assert node_disk_free > 0

0 comments on commit d64235b

Please sign in to comment.