github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/debian/patches/test--skip-pkg-system-chtimes-mips64.patch (about)

     1  From: Arnaud Rebillout <elboulangero@gmail.com>
     2  Date: Mon, 04 Jan 2021 10:39:35 +0700
     3  Subject: Skip pkg/system chtimes tests on mips64
     4  
     5      === RUN   TestChtimesLinux
     6          chtimes_linux_test.go:87: Expected: 2262-04-11 23:47:16 +0000 UTC, got: 1990-01-27 10:50:44 +0000 UTC
     7      --- FAIL: TestChtimesLinux (0.00s)
     8      === RUN   TestChtimes
     9          chtimes_test.go:92: Expected: 2262-04-11 23:47:16 +0000 UTC, got: 1990-01-27 10:50:44 +0000 UTC
    10      --- FAIL: TestChtimes (0.00s)
    11  
    12  Bug: https://github.com/moby/moby/issues/41850
    13  
    14  Index: docker/engine/pkg/system/chtimes_linux_test.go
    15  ===================================================================
    16  --- docker.orig/engine/pkg/system/chtimes_linux_test.go
    17  +++ docker/engine/pkg/system/chtimes_linux_test.go
    18  @@ -3,6 +3,8 @@ package system // import "github.com/doc
    19   import (
    20   	"os"
    21   	"syscall"
    22  +	"runtime"
    23  +	"strings"
    24   	"testing"
    25   	"time"
    26   )
    27  @@ -74,6 +76,11 @@ func TestChtimesLinux(t *testing.T) {
    28   	}
    29   
    30   	// Test both aTime and mTime set to Unix max time
    31  +	// Doesn't work on mips64, as stat struct has 32-bits types
    32  +	if strings.HasPrefix(runtime.GOARCH, "mips64") {
    33  +		return
    34  +	}
    35  +
    36   	Chtimes(file, unixMaxTime, unixMaxTime)
    37   
    38   	f, err = os.Stat(file)
    39  Index: docker/engine/pkg/system/chtimes_test.go
    40  ===================================================================
    41  --- docker.orig/engine/pkg/system/chtimes_test.go
    42  +++ docker/engine/pkg/system/chtimes_test.go
    43  @@ -3,6 +3,8 @@ package system // import "github.com/doc
    44   import (
    45   	"os"
    46   	"path/filepath"
    47  +	"runtime"
    48  +	"strings"
    49   	"testing"
    50   	"time"
    51   )
    52  @@ -80,6 +82,11 @@ func TestChtimes(t *testing.T) {
    53   	}
    54   
    55   	// Test both aTime and mTime set to Unix max time
    56  +	// Doesn't work on mips64, as stat struct has 32-bits types
    57  +	if strings.HasPrefix(runtime.GOARCH, "mips64") {
    58  +		return
    59  +	}
    60  +
    61   	Chtimes(file, unixMaxTime, unixMaxTime)
    62   
    63   	f, err = os.Stat(file)