mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-13 01:54:20 +08:00
🐛 fix(release): 修复镜像容量检查参数冲突
- 使用 POSIX df 输出读取 Gatewaysentry 可用空间 - 校验远端容量结果后再换算为字节 - 增加发布 action 容量命令回归测试
This commit is contained in:
@@ -12,6 +12,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT = Path(__file__).with_name("prepare-vps-release-payload.py")
|
||||
PUBLISH_ACTION = SCRIPT.parents[1] / ".github/actions/publish-vps-mirror/action.yml"
|
||||
|
||||
|
||||
def sha256(value: bytes) -> str:
|
||||
@@ -153,6 +154,14 @@ class PrepareVPSReleasePayloadTest(unittest.TestCase):
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn("invalid app asset name", result.stderr)
|
||||
|
||||
def test_publish_action_reads_remote_capacity_with_posix_df(self) -> None:
|
||||
source = PUBLISH_ACTION.read_text(encoding="utf-8")
|
||||
|
||||
self.assertIn("df -Pk '${mirror_root}'", source)
|
||||
self.assertNotIn("--output=avail", source)
|
||||
self.assertIn("available_kib", source)
|
||||
self.assertIn("available_kib * 1024", source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user