1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

refactor(tunasync):

1. refactored manager and worker to support TLS transport
2. if mirror_dir is specified from a mirror config, don't add the mirror name
这个提交包含在:
bigeagle
2016-04-28 21:02:39 +08:00
父节点 9865f28259
当前提交 9fbb8ab155
共有 5 个文件被更改,包括 38 次插入27 次删除

查看文件

@@ -65,7 +65,7 @@ func TestHTTPServer(t *testing.T) {
w := WorkerStatus{
ID: "test_worker1",
}
resp, err := postJSON(baseURL+"/workers", w)
resp, err := PostJSON(baseURL+"/workers", w, nil)
So(err, ShouldBeNil)
So(resp.StatusCode, ShouldEqual, http.StatusOK)
@@ -90,7 +90,7 @@ func TestHTTPServer(t *testing.T) {
Upstream: "mirrors.tuna.tsinghua.edu.cn",
Size: "3GB",
}
resp, err := postJSON(fmt.Sprintf("%s/workers/%s/jobs/%s", baseURL, status.Worker, status.Name), status)
resp, err := PostJSON(fmt.Sprintf("%s/workers/%s/jobs/%s", baseURL, status.Worker, status.Name), status, nil)
defer resp.Body.Close()
So(err, ShouldBeNil)
So(resp.StatusCode, ShouldEqual, http.StatusOK)
@@ -136,8 +136,8 @@ func TestHTTPServer(t *testing.T) {
Upstream: "mirrors.tuna.tsinghua.edu.cn",
Size: "4GB",
}
resp, err := postJSON(fmt.Sprintf("%s/workers/%s/jobs/%s",
baseURL, status.Worker, status.Name), status)
resp, err := PostJSON(fmt.Sprintf("%s/workers/%s/jobs/%s",
baseURL, status.Worker, status.Name), status, nil)
So(err, ShouldBeNil)
So(resp.StatusCode, ShouldEqual, http.StatusBadRequest)
defer resp.Body.Close()
@@ -156,7 +156,7 @@ func TestHTTPServer(t *testing.T) {
ID: "test_worker_cmd",
URL: workerBaseURL + "/cmd",
}
resp, err := postJSON(baseURL+"/workers", w)
resp, err := PostJSON(baseURL+"/workers", w, nil)
So(err, ShouldBeNil)
So(resp.StatusCode, ShouldEqual, http.StatusOK)
@@ -177,7 +177,7 @@ func TestHTTPServer(t *testing.T) {
MirrorID: "ubuntu-sync",
WorkerID: "not_exist_worker",
}
resp, err := postJSON(baseURL+"/cmd", clientCmd)
resp, err := PostJSON(baseURL+"/cmd", clientCmd, nil)
defer resp.Body.Close()
So(err, ShouldBeNil)
So(resp.StatusCode, ShouldEqual, http.StatusBadRequest)
@@ -190,7 +190,7 @@ func TestHTTPServer(t *testing.T) {
WorkerID: w.ID,
}
resp, err := postJSON(baseURL+"/cmd", clientCmd)
resp, err := PostJSON(baseURL+"/cmd", clientCmd, nil)
defer resp.Body.Close()
So(err, ShouldBeNil)