mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-09 23:42:20 +08:00
gateway: add CurrentCommit to /version
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
This commit is contained in:
@ -401,6 +401,8 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestVersion(t *testing.T) {
|
||||
config.CurrentCommit = "theshortcommithash"
|
||||
|
||||
ns := mockNamesys{}
|
||||
ts, _ := newTestServerAndNode(t, ns)
|
||||
t.Logf("test server url: %s", ts.URL)
|
||||
@ -421,6 +423,10 @@ func TestVersion(t *testing.T) {
|
||||
}
|
||||
s := string(body)
|
||||
|
||||
if !strings.Contains(s, "Commit: theshortcommithash") {
|
||||
t.Fatalf("response doesn't contain commit:\n%s", s)
|
||||
}
|
||||
|
||||
if !strings.Contains(s, "Client Version: "+id.ClientVersion) {
|
||||
t.Fatalf("response doesn't contain client version:\n%s", s)
|
||||
}
|
||||
|
Reference in New Issue
Block a user