mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-22 08:44:25 +01:00
When imported, the vc files carried in the 'full style' apache license text, but the standard for kata is to use SPDX style. Update the relevant files to SPDX. Fixes: #227 Signed-off-by: Graham whaley <graham.whaley@intel.com>
33 lines
589 B
Go
33 lines
589 B
Go
// Copyright (c) 2016 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func testNsEnterFormatArgs(t *testing.T, args []string, expected string) {
|
|
nsenter := &nsenter{}
|
|
|
|
cmd, err := nsenter.formatArgs(args)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if strings.Join(cmd, " ") != expected {
|
|
t.Fatal()
|
|
}
|
|
}
|
|
|
|
func TestNsEnterFormatArgsHello(t *testing.T) {
|
|
expectedCmd := "nsenter --target -1 --mount --uts --ipc --net --pid echo hello"
|
|
|
|
args := []string{"echo", "hello"}
|
|
|
|
testNsEnterFormatArgs(t, args, expectedCmd)
|
|
}
|