commit
bce18cb04f
@ -21,7 +21,6 @@ package integration
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -116,7 +115,7 @@ func getCgroupMemoryLimitForTask(t *testing.T, task containerd.Task) uint64 {
|
|||||||
func isSwapLikelyEnabled() bool {
|
func isSwapLikelyEnabled() bool {
|
||||||
// Check whether swap is enabled.
|
// Check whether swap is enabled.
|
||||||
swapFile := "/proc/swaps"
|
swapFile := "/proc/swaps"
|
||||||
swapData, err := ioutil.ReadFile(swapFile)
|
swapData, err := os.ReadFile(swapFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// We can't read the file or it doesn't exist, assume we don't have swap.
|
// We can't read the file or it doesn't exist, assume we don't have swap.
|
||||||
return false
|
return false
|
||||||
|
@ -18,7 +18,6 @@ package integration
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
goruntime "runtime"
|
goruntime "runtime"
|
||||||
@ -76,7 +75,7 @@ func TestVolumeCopyUp(t *testing.T) {
|
|||||||
assert.Equal(t, len(volumePaths), 1, "expected exactly 1 volume")
|
assert.Equal(t, len(volumePaths), 1, "expected exactly 1 volume")
|
||||||
|
|
||||||
testFilePath := filepath.Join(volumePaths[0], "test_file")
|
testFilePath := filepath.Join(volumePaths[0], "test_file")
|
||||||
contents, err := ioutil.ReadFile(testFilePath)
|
contents, err := os.ReadFile(testFilePath)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, "test_content\n", string(contents))
|
assert.Equal(t, "test_content\n", string(contents))
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ func TestVolumeCopyUp(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
t.Logf("Check whether host path of the volume is updated")
|
t.Logf("Check whether host path of the volume is updated")
|
||||||
contents, err = ioutil.ReadFile(testFilePath)
|
contents, err = os.ReadFile(testFilePath)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, "new_content\n", string(contents))
|
assert.Equal(t, "new_content\n", string(contents))
|
||||||
}
|
}
|
||||||
@ -159,7 +158,7 @@ func getHostPathForVolumes(criRoot, containerID string) ([]string, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
volumes, err := ioutil.ReadDir(hostPath)
|
volumes, err := os.ReadDir(hostPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
goruntime "runtime"
|
goruntime "runtime"
|
||||||
@ -196,7 +196,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str
|
|||||||
}()
|
}()
|
||||||
// make sure to wait after start
|
// make sure to wait after start
|
||||||
go cmd.Wait()
|
go cmd.Wait()
|
||||||
if data, err := ioutil.ReadAll(os.Stdin); err == nil {
|
if data, err := io.ReadAll(os.Stdin); err == nil {
|
||||||
if len(data) > 0 {
|
if len(data) > 0 {
|
||||||
var any ptypes.Any
|
var any ptypes.Any
|
||||||
if err := proto.Unmarshal(data, &any); err != nil {
|
if err := proto.Unmarshal(data, &any); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user