Skip to content

Commit

Permalink
rptest: New license upgrade test
Browse files Browse the repository at this point in the history
- Ensures licenses can be read/written by cluster between versions

(cherry picked from commit 1efea4c)
  • Loading branch information
graphcareful committed Nov 24, 2022
1 parent 1b4dcbe commit 2559bdf
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/rptest/tests/license_upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,41 @@ def test_basic_upgrade(self):

# Install license
assert self.admin.put_license(license).status_code == 200


class UpgradeMigratingLicenseVersion(RedpandaTest):
"""
Verify that the cluster can interpret licenses between versions
"""
def __init__(self, test_context):
super(UpgradeMigratingLicenseVersion,
self).__init__(test_context=test_context,
num_brokers=3,
si_settings=SISettings())
self.installer = self.redpanda._installer
self.admin = Admin(self.redpanda)

def setUp(self):
# 22.2.x is when license went live
self.installer.install(self.redpanda.nodes, (22, 2, 7))
super(UpgradeMigratingLicenseVersion, self).setUp()

@cluster(num_nodes=3, log_allow_list=RESTART_LOG_ALLOW_LIST)
def test_license_upgrade(self):
license = sample_license()
if license is None:
self.logger.info(
"Skipping test, REDPANDA_SAMPLE_LICENSE env var not found")
return

# Upload a license
self.admin.put_license(license)

# Update all nodes to newest version
self.installer.install(self.redpanda.nodes, RedpandaInstaller.HEAD)
self.redpanda.restart_nodes(self.redpanda.nodes)
_ = wait_for_num_versions(self.redpanda, 1)

# Attempt to read license written by older version
license = self.admin.get_license()
assert license is not None and license['loaded'] is True

0 comments on commit 2559bdf

Please sign in to comment.