working commit

This commit is contained in:
2026-02-11 20:45:45 +02:00
parent 2e3dbe8f7c
commit d318f39f3c
15 changed files with 337 additions and 90 deletions
+15 -4
View File
@@ -19,9 +19,10 @@ import (
"mstore/app/server"
"github.com/stretchr/testify/require"
"sigs.k8s.io/yaml"
)
func xxxTestImageLife(t *testing.T) {
func TestImageLife(t *testing.T) {
var srvport int64 = 10250
srvdir := t.TempDir()
srvaddr := fmt.Sprintf("127.0.0.1:%d", srvport)
@@ -72,14 +73,24 @@ func xxxTestImageLife(t *testing.T) {
require.NoError(t, err)
require.True(t, helloRes)
}
{
// PishImage
fmt.Printf("=== PushImage ===\n")
cli := NewClient()
ctx := context.Background()
err := cli.PushImage(ctx, "test-oci.img", srvaddr+"/foo/test:123", 1*time.Second)
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
err := cli.PushImage(ctx, "test-oci.img", srvaddr+"/foo/test:123")
require.NoError(t, err)
}
{
// ImageInfo
fmt.Printf("=== ImageInfo ===\n")
cli := NewClient()
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
info, err := cli.ImageInfo(ctx, srvaddr+"/foo/test:123")
require.NoError(t, err)
infoYaml, err := yaml.Marshal(info)
require.NoError(t, err)
fmt.Printf("imageInfo:\n%s\n", string(infoYaml))
}
}