2015-04-08 01:57:54 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/docker/docker/api/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestLegacyImages(t *testing.T) {
|
2015-04-11 21:49:14 +00:00
|
|
|
_, body, err := sockRequest("GET", "/v1.6/images/json", nil)
|
2015-04-08 01:57:54 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Error on GET: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
images := []types.LegacyImage{}
|
|
|
|
if err = json.Unmarshal(body, &images); err != nil {
|
|
|
|
t.Fatalf("Error on unmarshal: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(images) == 0 || images[0].Tag == "" || images[0].Repository == "" {
|
|
|
|
t.Fatalf("Bad data: %q", images)
|
|
|
|
}
|
|
|
|
|
|
|
|
logDone("images - checking legacy json")
|
|
|
|
}
|