Skip to content

Commit

Permalink
fix: TOOLS-2714 truncating a namespace with --no-warn causes error (#224
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Jesse S authored Oct 27, 2023
1 parent 2130398 commit 4dee8f6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/live_cluster/manage_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ async def _do_default(self, line):
line=line,
arg="--no-warn",
default=False,
modifiers=self.modifiers,
modifiers=self.modifiers | self.required_modifiers,
mods=self.mods,
)

Expand Down
30 changes: 30 additions & 0 deletions test/e2e/live_cluster/test_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,3 +1097,33 @@ def test_check_for_OK_response(self, cmd, exp_title, exp_header):
for row in actual_values:
entry = row[1]
self.assertEqual(entry, ASINFO_RESPONSE_OK)


class ManageTruncateTest(TestManage):
def get_args(self, cmd):
return self._args.format(cmd)

def setUp(self):
lib.start()
self._args = f"-h {lib.SERVER_IP}:{lib.PORT} --enable -e '{{}}' -Uadmin -Padmin"

def tearDown(self) -> None:
lib.stop()

@parameterized.expand(
[
(
f"manage truncate ns test --no-warn",
"Successfully started truncation for namespace test",
),
(
f"manage truncate ns test set testset --no-warn",
"Successfully started truncation for set testset of namespace test",
),
]
)
def test_check_for_OK_response(self, cmd, exp_stdout):
cp = test_util.run_asadm(self.get_args(cmd))
stdout = cp.stdout

self.assertEqual(exp_stdout, stdout.strip())

0 comments on commit 4dee8f6

Please sign in to comment.