Skip to content

Commit

Permalink
tests: test topic creation with invalid configs
Browse files Browse the repository at this point in the history
Add tests for topic creation requests that use unexpected literal
values (e.g. `compression.type=foo`).
  • Loading branch information
Vlad Lazar committed May 26, 2022
1 parent 0343702 commit bac883a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/rptest/tests/rpk_topic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0

from ducktape.mark import parametrize
from ducktape.utils.util import wait_until
from rptest.services.cluster import cluster
import ducktape.errors

from rptest.tests.redpanda_test import RedpandaTest
from rptest.clients.rpk import RpkTool
from rptest.clients.rpk import RpkTool, RpkException
from rptest.services.rpk_consumer import RpkConsumer
from rptest.util import expect_exception

import time
import random
Expand All @@ -34,6 +36,16 @@ def test_create_topic(self):
backoff_sec=1,
err_msg="Topic never appeared.")

@cluster(num_nodes=1)
@parametrize(config_type="compression.type")
@parametrize(config_type="compaction.strategy")
@parametrize(config_type="message.timestamp.type")
@parametrize(config_type="cleanup.policy")
def test_create_topic_with_invalid_config(self, config_type):
with expect_exception(RpkException,
lambda e: "INVALID_CONFIG" in str(e)):
out = self._rpk.create_topic("topic", config={config_type: "foo"})

@cluster(num_nodes=4)
def test_produce(self):
topic = 'topic'
Expand Down

0 comments on commit bac883a

Please sign in to comment.