Skip to content

Commit

Permalink
fix api server test, dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
p4gefau1t committed Jul 14, 2020
1 parent 63676f4 commit c010e7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ RUN apk add git make &&\
git clone https://github.com/p4gefau1t/trojan-go.git &&\
cd trojan-go &&\
make &&\
wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O bin/geosite.dat &&\
wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O bin/geoip.dat
wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O build/geosite.dat &&\
wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O build/geoip.dat

FROM alpine
WORKDIR /
COPY --from=builder /trojan-go/bin /usr/local/bin/
COPY --from=builder /trojan-go/build /usr/local/bin/
COPY --from=builder /trojan-go/example/server.json /etc/trojan-go/config.json

ENTRYPOINT ["/usr/local/bin/trojan-go", "-config"]
Expand Down
5 changes: 1 addition & 4 deletions api/service/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestServerAPI(t *testing.T) {
}
stream1.CloseSend()
user.AddTraffic(1234, 5678)
time.Sleep(time.Millisecond * 1000)
time.Sleep(time.Second * 1)
stream2, err := server.GetUsers(ctx)
common.Must(err)
stream2.Send(&GetUsersRequest{
Expand All @@ -68,9 +68,6 @@ func TestServerAPI(t *testing.T) {
if resp2.Status.TrafficTotal.DownloadTraffic != 1234 || resp2.Status.TrafficTotal.UploadTraffic != 5678 {
t.Fatal("wrong traffic")
}
if resp2.Status.SpeedCurrent.DownloadSpeed != 1234 || resp2.Status.TrafficTotal.UploadTraffic != 5678 {
t.Fatal("wrong speed")
}

stream3, err := server.SetUsers(ctx)
stream3.Send(&SetUsersRequest{
Expand Down

0 comments on commit c010e7d

Please sign in to comment.