diff --git a/testcontainers/iris/__init__.py b/testcontainers/iris/__init__.py index 571f3b8..20543f1 100644 --- a/testcontainers/iris/__init__.py +++ b/testcontainers/iris/__init__.py @@ -54,9 +54,9 @@ def __init__( self.with_exposed_ports(self.port) def _configure(self) -> None: - self.with_env("IRIS_USERNAME", self.username) - self.with_env("IRIS_PASSWORD", self.password) - self.with_env("IRIS_NAMESPACE", self.namespace) + # self.with_env("IRIS_USERNAME", self.username) + # self.with_env("IRIS_PASSWORD", self.password) + # self.with_env("IRIS_NAMESPACE", self.namespace) if self.license_key: self.with_volume_mapping( self.license_key, "/usr/irissys/mgr/iris.key", "ro" @@ -64,26 +64,23 @@ def _configure(self) -> None: def _connect(self) -> None: wait_for_logs(self, predicate="Enabling logons") - if self.image.startswith("intersystemsdc"): - wait_for_logs(self, predicate="executed command") - else: - if self.namespace.upper() != "USER": - cmd = ( - f"iris session iris -U %%SYS '##class(%%SQL.Statement).%%ExecDirect(,\"CREATE DATABASE %s\")'" - % (self.namespace,) - ) - self.exec(cmd) + if self.namespace.upper() != "USER": cmd = ( - f'iris session iris -U %%SYS \'##class(Security.Users).Create("%s","%s","%s",,"%s")\'' - % ( - self.username, - "%ALL", - self.password, - self.namespace, - ) + f"iris session iris -U %%SYS '##class(%%SQL.Statement).%%ExecDirect(,\"CREATE DATABASE %s\")'" + % (self.namespace,) ) res = self.exec(cmd) print("res", cmd, res) + cmd = ( + f'iris session iris -U %%SYS \'##class(Security.Users).Create("%s","%s","%s")\'' + % ( + self.username, + "%ALL", + self.password, + ) + ) + res = self.exec(cmd) + print("res", cmd, res) def get_connection_url(self, host=None) -> str: return super()._create_connection_url( diff --git a/tests/test_iris.py b/tests/test_iris.py index a5224c5..7d55262 100644 --- a/tests/test_iris.py +++ b/tests/test_iris.py @@ -17,14 +17,20 @@ def check_connection(iris): def test_community(): - iris_container = IRISContainer("intersystemsdc/iris-community:2023.1.1.380.0-zpm", **creds) + iris_container = IRISContainer("containers.intersystems.com/intersystems/iris-community:latest-em", **creds) + with iris_container as iris: + check_connection(iris) + + +def test_dccommunity(): + iris_container = IRISContainer("intersystemsdc/iris-community:latest", **creds) with iris_container as iris: check_connection(iris) def test_enterprise(): license_key = os.path.abspath(os.path.expanduser("~/iris.key")) - iris_container = IRISContainer("containers.intersystems.com/intersystems/iris:2023.3", license_key=license_key, + iris_container = IRISContainer("containers.intersystems.com/intersystems/iris:latest-cd", license_key=license_key, **creds) with iris_container as iris: check_connection(iris)