fix(agent-call): support automatic spot pricing

This commit is contained in:
2026-09-13 12:56:41 +08:00
parent 3d206f7f20
commit d4fa33477d
2 changed files with 16 additions and 4 deletions
+8
View File
@@ -138,6 +138,14 @@ class CloudTests(unittest.TestCase):
self.assertEqual(params["SystemDisk.PerformanceLevel"], "PL1")
self.assertEqual(api.mutations(), ["RunInstances", "AssociateEipAddress"])
def test_automatic_spot_price_omits_price_limit(self):
cfg = config()
cfg["spot_strategy"] = "SpotAsPriceGo"
cfg.pop("spot_price_limit")
params = cloud.create_params(cfg)
self.assertEqual(params["SpotStrategy"], "SpotAsPriceGo")
self.assertNotIn("SpotPriceLimit", params)
def test_user_data_is_base64_encoded_without_logging_content(self):
with tempfile.TemporaryDirectory() as d:
user_data = Path(d) / "bootstrap.sh"