Mercurial > hg > orthanc-tests
comparison NewTests/PostgresUpgrades/test_pg_upgrades.py @ 630:e1bc43b5a7d2
fix leading /
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 28 Feb 2024 12:50:49 +0100 |
parents | ddf83317c7e0 |
children | e3d41c4168c3 |
comparison
equal
deleted
inserted
replaced
629:ed0a51317c0b | 630:e1bc43b5a7d2 |
---|---|
61 o.wait_started() | 61 o.wait_started() |
62 | 62 |
63 # make sure we can 'play' with this Orthanc | 63 # make sure we can 'play' with this Orthanc |
64 o.instances.get_tags(orthanc_id=instances[0]) | 64 o.instances.get_tags(orthanc_id=instances[0]) |
65 o.instances.delete_all() | 65 o.instances.delete_all() |
66 self.assertEqual(0, int(o.get_json('/statistics')['TotalDiskSize'])) | 66 self.assertEqual(0, int(o.get_json('statistics')['TotalDiskSize'])) |
67 instances = o.upload_folder(here / "../../Database/Knee") | 67 instances = o.upload_folder(here / "../../Database/Knee") |
68 size_before_downgrade = int(o.get_json('/statistics')['TotalDiskSize']) | 68 size_before_downgrade = int(o.get_json('statistics')['TotalDiskSize']) |
69 | 69 |
70 print("Stopping newest Orthanc ") | 70 print("Stopping newest Orthanc ") |
71 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) | 71 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) |
72 time.sleep(2) | 72 time.sleep(2) |
73 | 73 |
105 o.wait_started() | 105 o.wait_started() |
106 | 106 |
107 # make sure we can 'play' with Orthanc | 107 # make sure we can 'play' with Orthanc |
108 o.instances.get_tags(orthanc_id=instances[0]) | 108 o.instances.get_tags(orthanc_id=instances[0]) |
109 o.instances.delete_all() | 109 o.instances.delete_all() |
110 self.assertEqual(0, int(o.get_json('/statistics')['TotalDiskSize'])) | 110 self.assertEqual(0, int(o.get_json('statistics')['TotalDiskSize'])) |
111 instances = o.upload_folder(here / "../../Database/Knee") | 111 instances = o.upload_folder(here / "../../Database/Knee") |
112 size_before_downgrade = int(o.get_json('/statistics')['TotalDiskSize']) | 112 size_before_downgrade = int(o.get_json('statistics')['TotalDiskSize']) |
113 | 113 |
114 print("Stopping newest Orthanc ") | 114 print("Stopping newest Orthanc ") |
115 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) | 115 subprocess.run(["docker", "compose", "stop", "orthanc-pg-15-under-tests"], check=True) |
116 time.sleep(2) | 116 time.sleep(2) |
117 | 117 |
125 o = OrthancApiClient("http://localhost:8052") | 125 o = OrthancApiClient("http://localhost:8052") |
126 o.wait_started() | 126 o.wait_started() |
127 | 127 |
128 # make sure we can 'play' with Orthanc | 128 # make sure we can 'play' with Orthanc |
129 o.instances.get_tags(orthanc_id=instances[0]) | 129 o.instances.get_tags(orthanc_id=instances[0]) |
130 self.assertEqual(size_before_downgrade, int(o.get_json('/statistics')['TotalDiskSize'])) | 130 self.assertEqual(size_before_downgrade, int(o.get_json('statistics')['TotalDiskSize'])) |
131 o.instances.delete_all() | 131 o.instances.delete_all() |
132 self.assertEqual(0, int(o.get_json('/statistics')['TotalDiskSize'])) | 132 self.assertEqual(0, int(o.get_json('statistics')['TotalDiskSize'])) |
133 instances = o.upload_folder(here / "../../Database/Knee") | 133 instances = o.upload_folder(here / "../../Database/Knee") |
134 o.instances.delete_all() | 134 o.instances.delete_all() |
135 self.assertEqual(0, int(o.get_json('/statistics')['TotalDiskSize'])) | 135 self.assertEqual(0, int(o.get_json('statistics')['TotalDiskSize'])) |
136 | 136 |
137 print("run the integration tests after a downgrade") | 137 print("run the integration tests after a downgrade") |
138 # first create the containers (orthanc-tests + orthanc-pg-15-61-for-integ-tests) so they know each other | 138 # first create the containers (orthanc-tests + orthanc-pg-15-61-for-integ-tests) so they know each other |
139 # subprocess.run(["docker", "compose", "create", "orthanc-tests"], check=True) | 139 # subprocess.run(["docker", "compose", "create", "orthanc-tests"], check=True) |
140 | 140 |