# HG changeset patch # User Alain Mazy # Date 1706088847 -3600 # Node ID d743c210cbc8a4000f7a8463f8ca27fb2965f743 # Parent 0700fe8e2b7822d226367e62e2308bf9be4f6b53 test pg upgrade from 6.1 to 6.2 diff -r 0700fe8e2b78 -r d743c210cbc8 NewTests/PostgresUpgrades/test_pg_upgrades.py --- a/NewTests/PostgresUpgrades/test_pg_upgrades.py Tue Jan 23 12:22:07 2024 +0100 +++ b/NewTests/PostgresUpgrades/test_pg_upgrades.py Wed Jan 24 10:34:07 2024 +0100 @@ -27,8 +27,55 @@ cls.cleanup() + def test_upgrade_61_to_62(self): + # remove everything including the DB from previous tests + TestPgUpgrades.cleanup() + + print("Pullling container") + subprocess.run(["docker", "compose", "pull"], check=True) + + print("Launching PG-15 server") + subprocess.run(["docker", "compose", "up", "pg-15", "-d"], check=True) + wait_container_healthy("pg-15") + + print("Launching Orthanc with 6.1 DB") + subprocess.run(["docker", "compose", "up", "orthanc-pg-15-61", "-d"], check=True) + + o = OrthancApiClient("http://localhost:8052") + o.wait_started() + + instances = o.upload_folder(here / "../../Database/Knee") + + print("Stopping Orthanc with 6.1 DB") + subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-61"], check=True) + time.sleep(2) + + print("Launching newest Orthanc") + subprocess.run(["docker", "compose", "up", "orthanc-pg-15-under-tests", "-d"], + env= { + "ORTHANC_IMAGE_UNDER_TESTS": Helpers.orthanc_under_tests_docker_image + }, + check=True) + + o = OrthancApiClient("http://localhost:8050") + o.wait_started() + + # make sure we can 'play' with this Orthanc + o.instances.get_tags(orthanc_id=instances[0]) + o.instances.delete_all() + self.assertEqual(0, int(o.get_json('/statistics')['TotalDiskSize'])) + instances = o.upload_folder(here / "../../Database/Knee") + size_before_downgrade = int(o.get_json('/statistics')['TotalDiskSize']) + + print("Stopping newest Orthanc ") + subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) + time.sleep(2) + def test_upgrades_downgrades_with_pg_15(self): + # remove everything including the DB from previous tests + TestPgUpgrades.cleanup() + print("Pullling container") subprocess.run(["docker", "compose", "pull"], check=True) @@ -104,6 +151,10 @@ def test_latest_orthanc_with_pg_9(self): + + # remove everything including the DB from previous tests + TestPgUpgrades.cleanup() + print("Launching PG-9 server") subprocess.run(["docker", "compose", "up", "pg-9", "-d"], check=True) wait_container_healthy("pg-9")