added beta file locker; updates tests

This commit is contained in:
2026-02-25 16:12:25 +02:00
parent d6d2721c88
commit 3cf01ae30b
5 changed files with 57 additions and 41 deletions
+12 -12
View File
@@ -70,7 +70,7 @@ func TestAccountLife(t *testing.T) {
{
// ServiceHello
fmt.Printf("=== ServiceHello ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
helloRes, err := cli.ServiceHello(ctx, srvaddr+"/hello", 1*time.Second)
require.NoError(t, err)
@@ -84,7 +84,7 @@ func TestAccountLife(t *testing.T) {
{
// CreateAccount
fmt.Printf("=== CreateAccount ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -95,7 +95,7 @@ func TestAccountLife(t *testing.T) {
{
// CreateGrant
fmt.Printf("=== CreateGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -106,7 +106,7 @@ func TestAccountLife(t *testing.T) {
{
// UpdateGrant
fmt.Printf("=== UpdateGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -116,7 +116,7 @@ func TestAccountLife(t *testing.T) {
{
// CreateGrant
fmt.Printf("=== CreateGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -128,7 +128,7 @@ func TestAccountLife(t *testing.T) {
{
// GetGrant
fmt.Printf("=== GetGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -143,7 +143,7 @@ func TestAccountLife(t *testing.T) {
{
// UpdateGrant
fmt.Printf("=== UpdateGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -153,7 +153,7 @@ func TestAccountLife(t *testing.T) {
{
// GetGrant
fmt.Printf("=== GetGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -168,7 +168,7 @@ func TestAccountLife(t *testing.T) {
{
// DeleteGrant
fmt.Printf("=== DeleteGrant ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -178,7 +178,7 @@ func TestAccountLife(t *testing.T) {
{
// GetAccount
fmt.Printf("=== GetAccount ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -191,7 +191,7 @@ func TestAccountLife(t *testing.T) {
{
// ListAccounts
fmt.Printf("=== ListAccounts ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -209,7 +209,7 @@ func TestAccountLife(t *testing.T) {
{
// DeleteAccount
fmt.Printf("=== DeleteAccount ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
+7 -7
View File
@@ -72,7 +72,7 @@ func TestFileLife(t *testing.T) {
{
// ServiceHello
fmt.Printf("=== ServiceHello ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
helloRes, err := cli.ServiceHello(ctx, srvaddr+"/hello", 1*time.Second)
require.NoError(t, err)
@@ -93,7 +93,7 @@ func TestFileLife(t *testing.T) {
require.NoError(t, err)
fmt.Printf("=== PutFile ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -103,7 +103,7 @@ func TestFileLife(t *testing.T) {
{
// FileInfo
fmt.Printf("=== FileInfo ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -115,7 +115,7 @@ func TestFileLife(t *testing.T) {
{
// GetFile
fmt.Printf("=== GetFile ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -129,7 +129,7 @@ func TestFileLife(t *testing.T) {
{
// ListFiles
fmt.Printf("=== ListFiles ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -140,7 +140,7 @@ func TestFileLife(t *testing.T) {
{
// DeleteFile
fmt.Printf("=== DeleteFile ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
@@ -150,7 +150,7 @@ func TestFileLife(t *testing.T) {
{
// !FileInfo
fmt.Printf("=== FileInfo ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
+8 -8
View File
@@ -70,7 +70,7 @@ func TestImageLife(t *testing.T) {
{
// ServiceHello
fmt.Printf("=== ServiceHello ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx := context.Background()
helloRes, err := cli.ServiceHello(ctx, srvaddr+"/hello", 1*time.Second)
require.NoError(t, err)
@@ -79,26 +79,26 @@ func TestImageLife(t *testing.T) {
{
// PishImage
fmt.Printf("=== PushImage ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
err := cli.PushImage(ctx, "test-oci.tar", srvaddr+"/foo/test:123")
require.NoError(t, err)
}
{
// ImageInfo
fmt.Printf("=== ImageInfo ===\n")
cli := client.NewClient()
// ImageAmnifest
fmt.Printf("=== ImageManifest ===\n")
cli := client.NewClient(true)
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
info, err := cli.ImageInfo(ctx, srvaddr+"/foo/test:123")
info, err := cli.ImageManifest(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))
fmt.Printf("imagemanifest:\n%s\n", string(infoYaml))
}
{
// DeleteImage
fmt.Printf("=== DeleteImage ===\n")
cli := client.NewClient()
cli := client.NewClient(true)
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
err := cli.DeleteImage(ctx, srvaddr+"/foo/test:123")
require.NoError(t, err)