summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/common/create.go4
-rw-r--r--cmd/podman/pods/create.go14
-rw-r--r--docs/source/markdown/podman-pod-create.1.md19
-rw-r--r--go.mod2
-rw-r--r--go.sum3
-rw-r--r--libpod/define/pod_inspect.go2
-rw-r--r--libpod/options.go20
-rw-r--r--libpod/pod.go2
-rw-r--r--libpod/pod_api.go2
-rw-r--r--libpod/runtime_pod_infra_linux.go5
-rw-r--r--pkg/domain/entities/pods.go1
-rw-r--r--pkg/specgen/generate/pod_create.go3
-rw-r--r--pkg/specgen/generate/security.go46
-rw-r--r--pkg/specgen/pod_validate.go4
-rw-r--r--pkg/specgen/podspecgen.go3
-rw-r--r--test/e2e/checkpoint_test.go2
-rw-r--r--test/e2e/common_test.go42
-rw-r--r--test/e2e/config.go4
-rw-r--r--test/e2e/containers_conf_test.go8
-rw-r--r--test/e2e/create_staticip_test.go4
-rw-r--r--test/e2e/create_test.go4
-rw-r--r--test/e2e/libpod_suite_remote_test.go12
-rw-r--r--test/e2e/libpod_suite_test.go14
-rw-r--r--test/e2e/libpod_suite_varlink_test.go9
-rw-r--r--test/e2e/login_logout_test.go8
-rw-r--r--test/e2e/mount_test.go8
-rw-r--r--test/e2e/network_create_test.go2
-rw-r--r--test/e2e/network_test.go2
-rw-r--r--test/e2e/pause_test.go8
-rw-r--r--test/e2e/pod_create_test.go12
-rw-r--r--test/e2e/pod_pause_test.go2
-rw-r--r--test/e2e/pod_stats_test.go4
-rw-r--r--test/e2e/ps_test.go2
-rw-r--r--test/e2e/push_test.go6
-rw-r--r--test/e2e/run_cgroup_parent_test.go4
-rw-r--r--test/e2e/run_cleanup_test.go2
-rw-r--r--test/e2e/run_cpu_test.go8
-rw-r--r--test/e2e/run_device_test.go2
-rw-r--r--test/e2e/run_memory_test.go39
-rw-r--r--test/e2e/run_networking_test.go18
-rw-r--r--test/e2e/run_privileged_test.go2
-rw-r--r--test/e2e/run_staticip_test.go2
-rw-r--r--test/e2e/run_test.go45
-rw-r--r--test/e2e/run_volume_test.go2
-rw-r--r--test/e2e/search_test.go14
-rw-r--r--test/e2e/stats_test.go4
-rw-r--r--test/e2e/systemd_test.go2
-rw-r--r--test/e2e/tree_test.go4
-rw-r--r--test/e2e/volume_ls_test.go2
-rw-r--r--test/system/030-run.bats43
-rwxr-xr-xtest/system/build-testimage7
-rw-r--r--test/system/helpers.bash2
-rw-r--r--transfer.md8
-rw-r--r--vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE9
-rw-r--r--vendor/github.com/konsorten/go-windows-terminal-sequences/README.md42
-rw-r--r--vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod1
-rw-r--r--vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go35
-rw-r--r--vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go11
-rw-r--r--vendor/github.com/sirupsen/logrus/.gitignore2
-rw-r--r--vendor/github.com/sirupsen/logrus/buffer_pool.go52
-rw-r--r--vendor/github.com/sirupsen/logrus/entry.go14
-rw-r--r--vendor/github.com/sirupsen/logrus/exported.go45
-rw-r--r--vendor/github.com/sirupsen/logrus/go.mod3
-rw-r--r--vendor/github.com/sirupsen/logrus/go.sum6
-rw-r--r--vendor/github.com/sirupsen/logrus/logger.go54
-rw-r--r--vendor/github.com/sirupsen/logrus/terminal_check_windows.go29
-rw-r--r--vendor/modules.txt4
67 files changed, 496 insertions, 304 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index bb4726817..bb5eb9f38 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -389,7 +389,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
createFlags.StringVar(
&cf.Restart,
"restart", "",
- `Restart policy to apply when a container exits ("always"|"no"|"on-failure")`,
+ `Restart policy to apply when a container exits ("always"|"no"|"on-failure"|"unless-stopped")`,
)
createFlags.BoolVar(
&cf.Rm,
@@ -448,7 +448,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
createFlags.StringSliceVar(
&cf.Sysctl,
- "sysctl", containerConfig.Sysctls(),
+ "sysctl", []string{},
"Sysctl options",
)
createFlags.StringVar(
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index d8d32b930..ac6d83edd 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -141,14 +141,20 @@ func create(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
+ parts := strings.SplitN(netInput, ":", 2)
+
n := specgen.Namespace{}
- switch netInput {
- case "bridge":
+ switch {
+ case netInput == "bridge":
n.NSMode = specgen.Bridge
- case "host":
+ case netInput == "host":
n.NSMode = specgen.Host
- case "slirp4netns":
+ case netInput == "slirp4netns", strings.HasPrefix(netInput, "slirp4netns:"):
n.NSMode = specgen.Slirp
+ if len(parts) > 1 {
+ createOptions.Net.NetworkOptions = make(map[string][]string)
+ createOptions.Net.NetworkOptions[parts[0]] = strings.Split(parts[1], ",")
+ }
default:
// Container and NS mode are presently unsupported
n.NSMode = specgen.Bridge
diff --git a/docs/source/markdown/podman-pod-create.1.md b/docs/source/markdown/podman-pod-create.1.md
index d60fc65fe..7b0902c19 100644
--- a/docs/source/markdown/podman-pod-create.1.md
+++ b/docs/source/markdown/podman-pod-create.1.md
@@ -81,7 +81,20 @@ Assign a name to the pod.
**--network**=*mode*
-Set network mode for the pod. Supported values are *bridge* (the default), *host* (do not create a network namespace, all containers in the pod will use the host's network), or a comma-separated list of the names of CNI networks the pod should join.
+Set network mode for the pod. Supported values are
+- `bridge`: Create a network stack on the default bridge. This is the default for rootful containers.
+- `host`: Do not create a network namespace, all containers in the pod will use the host's network. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
+- Comma-separated list of the names of CNI networks the pod should join.
+- `slirp4netns[:OPTIONS,...]`: use slirp4netns to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options:
+ - **allow_host_loopback=true|false**: Allow the slirp4netns to reach the host loopback IP (`10.0.2.2`). Default is false.
+ - **cidr=CIDR**: Specify ip range to use for this network. (Default is `10.0.2.0/24`).
+ - **enable_ipv6=true|false**: Enable IPv6. Default is false. (Required for `outbound_addr6`).
+ - **outbound_addr=INTERFACE**: Specify the outbound interface slirp should bind to (ipv4 traffic only).
+ - **outbound_addr=IPv4**: Specify the outbound ipv4 address slirp should bind to.
+ - **outbound_addr6=INTERFACE**: Specify the outbound interface slirp should bind to (ipv6 traffic only).
+ - **outbound_addr6=IPv6**: Specify the outbound ipv6 address slirp should bind to.
+ - **port_handler=rootlesskit**: Use rootlesskit for port forwarding. Default.
+ - **port_handler=slirp4netns**: Use the slirp4netns port forwarding.
**--no-hosts**=**true**|**false**
@@ -129,6 +142,10 @@ $ podman pod create --infra=false
$ podman pod create --infra-command /top
$ podman pod create --publish 8443:443
+
+$ podman pod create --network slirp4netns:outbound_addr=127.0.0.1,allow_host_loopback=true
+
+$ podman pod create --network slirp4netns:cidr=192.168.0.0/24
```
## SEE ALSO
diff --git a/go.mod b/go.mod
index 4c9e88f25..efce43df8 100644
--- a/go.mod
+++ b/go.mod
@@ -50,7 +50,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0
github.com/rootless-containers/rootlesskit v0.10.1
- github.com/sirupsen/logrus v1.6.0
+ github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1
diff --git a/go.sum b/go.sum
index a865c4682..e8c608fc5 100644
--- a/go.sum
+++ b/go.sum
@@ -429,6 +429,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
+github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
@@ -572,6 +574,7 @@ golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/libpod/define/pod_inspect.go b/libpod/define/pod_inspect.go
index 60e19fe05..a4115eb92 100644
--- a/libpod/define/pod_inspect.go
+++ b/libpod/define/pod_inspect.go
@@ -89,6 +89,8 @@ type InspectPodInfraConfig struct {
HostAdd []string
// Networks is a list of CNI networks the pod will join.
Networks []string
+ // NetworkOptions are additional options for each network
+ NetworkOptions map[string][]string
}
// InspectPodContainerInfo contains information on a container in a pod.
diff --git a/libpod/options.go b/libpod/options.go
index f7b3419e5..f7190d0e3 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -2203,3 +2203,23 @@ func WithPodInfraExitCommand(exitCmd []string) PodCreateOption {
return nil
}
}
+
+// WithPodSlirp4netns tells the pod to use slirp4netns.
+func WithPodSlirp4netns(networkOptions map[string][]string) PodCreateOption {
+ return func(pod *Pod) error {
+ if pod.valid {
+ return define.ErrPodFinalized
+ }
+
+ if !pod.config.InfraContainer.HasInfraContainer {
+ return errors.Wrapf(define.ErrInvalidArg, "cannot configure pod networking as no infra container is being created")
+ }
+ if pod.config.InfraContainer.HostNetwork {
+ return errors.Wrapf(define.ErrInvalidArg, "cannot set both HostNetwork and Slirp4netns")
+ }
+ pod.config.InfraContainer.Slirp4netns = true
+ pod.config.InfraContainer.NetworkOptions = networkOptions
+
+ return nil
+ }
+}
diff --git a/libpod/pod.go b/libpod/pod.go
index 709184008..a5a0532be 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -107,6 +107,8 @@ type InfraContainerConfig struct {
ExitCommand []string `json:"exitCommand,omitempty"`
InfraImage string `json:"infraImage,omitempty"`
InfraCommand []string `json:"infraCommand,omitempty"`
+ Slirp4netns bool `json:"slirp4netns,omitempty"`
+ NetworkOptions map[string][]string `json:"network_options,omitempty"`
}
// ID retrieves the pod's ID
diff --git a/libpod/pod_api.go b/libpod/pod_api.go
index ec4cc08f7..0ae180356 100644
--- a/libpod/pod_api.go
+++ b/libpod/pod_api.go
@@ -584,7 +584,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
infraConfig.Networks = make([]string, 0, len(p.config.InfraContainer.Networks))
infraConfig.Networks = append(infraConfig.Networks, p.config.InfraContainer.Networks...)
}
-
+ infraConfig.NetworkOptions = p.config.InfraContainer.NetworkOptions
infraConfig.PortBindings = makeInspectPortBindings(p.config.InfraContainer.PortBindings)
}
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index 570cdd38f..7f58e86d8 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -81,8 +81,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
// Since user namespace sharing is not implemented, we only need to check if it's rootless
if !p.config.InfraContainer.HostNetwork {
netmode := "bridge"
- if isRootless {
+ if isRootless || p.config.InfraContainer.Slirp4netns {
netmode = "slirp4netns"
+ if len(p.config.InfraContainer.NetworkOptions) != 0 {
+ options = append(options, WithNetworkOptions(p.config.InfraContainer.NetworkOptions))
+ }
}
// PostConfigureNetNS should not be set since user namespace sharing is not implemented
// and rootless networking no longer supports post configuration setup
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index 7b38dbd87..426419833 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -142,6 +142,7 @@ func (p PodCreateOptions) ToPodSpecGen(s *specgen.PodSpecGenerator) {
s.StaticMAC = p.Net.StaticMAC
s.PortMappings = p.Net.PublishPorts
s.CNINetworks = p.Net.CNINetworks
+ s.NetworkOptions = p.Net.NetworkOptions
if p.Net.UseImageResolvConf {
s.NoManageResolvConf = true
}
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 101201252..43caf0fe9 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -99,6 +99,9 @@ func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime) ([]libpod
case specgen.Host:
logrus.Debugf("Pod will use host networking")
options = append(options, libpod.WithPodHostNetwork())
+ case specgen.Slirp:
+ logrus.Debugf("Pod will use slirp4netns")
+ options = append(options, libpod.WithPodSlirp4netns(p.NetworkOptions))
default:
return nil, errors.Errorf("pods presently do not support network mode %s", p.NetNS.NSMode)
}
diff --git a/pkg/specgen/generate/security.go b/pkg/specgen/generate/security.go
index 87e8029a7..7c818cf62 100644
--- a/pkg/specgen/generate/security.go
+++ b/pkg/specgen/generate/security.go
@@ -7,6 +7,7 @@ import (
"github.com/containers/common/pkg/capabilities"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v2/libpod"
+ "github.com/containers/podman/v2/libpod/define"
"github.com/containers/podman/v2/libpod/image"
"github.com/containers/podman/v2/pkg/specgen"
"github.com/containers/podman/v2/pkg/util"
@@ -167,7 +168,52 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator,
}
g.SetRootReadonly(s.ReadOnlyFilesystem)
+
+ // Add default sysctls
+ defaultSysctls, err := util.ValidateSysctls(rtc.Sysctls())
+ if err != nil {
+ return err
+ }
+ for sysctlKey, sysctlVal := range defaultSysctls {
+
+ // Ignore mqueue sysctls if --ipc=host
+ if s.IpcNS.IsHost() && strings.HasPrefix(sysctlKey, "fs.mqueue.") {
+ logrus.Infof("Sysctl %s=%s ignored in containers.conf, since IPC Namespace set to host", sysctlKey, sysctlVal)
+
+ continue
+ }
+
+ // Ignore net sysctls if --net=host
+ if s.NetNS.IsHost() && strings.HasPrefix(sysctlKey, "net.") {
+ logrus.Infof("Sysctl %s=%s ignored in containers.conf, since Network Namespace set to host", sysctlKey, sysctlVal)
+ continue
+ }
+
+ // Ignore uts sysctls if --uts=host
+ if s.UtsNS.IsHost() && (strings.HasPrefix(sysctlKey, "kernel.domainname") || strings.HasPrefix(sysctlKey, "kernel.hostname")) {
+ logrus.Infof("Sysctl %s=%s ignored in containers.conf, since UTS Namespace set to host", sysctlKey, sysctlVal)
+ continue
+ }
+
+ g.AddLinuxSysctl(sysctlKey, sysctlVal)
+ }
+
for sysctlKey, sysctlVal := range s.Sysctl {
+
+ if s.IpcNS.IsHost() && strings.HasPrefix(sysctlKey, "fs.mqueue.") {
+ return errors.Wrapf(define.ErrInvalidArg, "sysctl %s=%s can't be set since IPC Namespace set to host", sysctlKey, sysctlVal)
+ }
+
+ // Ignore net sysctls if --net=host
+ if s.NetNS.IsHost() && strings.HasPrefix(sysctlKey, "net.") {
+ return errors.Wrapf(define.ErrInvalidArg, "sysctl %s=%s can't be set since Host Namespace set to host", sysctlKey, sysctlVal)
+ }
+
+ // Ignore uts sysctls if --uts=host
+ if s.UtsNS.IsHost() && (strings.HasPrefix(sysctlKey, "kernel.domainname") || strings.HasPrefix(sysctlKey, "kernel.hostname")) {
+ return errors.Wrapf(define.ErrInvalidArg, "sysctl %s=%s can't be set since UTS Namespace set to host", sysctlKey, sysctlVal)
+ }
+
g.AddLinuxSysctl(sysctlKey, sysctlVal)
}
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index 907c0bb69..a6c61a203 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -72,9 +72,9 @@ func (p *PodSpecGenerator) Validate() error {
return exclusivePodOptions("NoInfra", "NoManageResolvConf")
}
}
- if p.NetNS.NSMode != "" && p.NetNS.NSMode != Bridge && p.NetNS.NSMode != Default {
+ if p.NetNS.NSMode != "" && p.NetNS.NSMode != Bridge && p.NetNS.NSMode != Slirp && p.NetNS.NSMode != Default {
if len(p.PortMappings) > 0 {
- return errors.New("PortMappings can only be used with Bridge mode networking")
+ return errors.New("PortMappings can only be used with Bridge or slirp4netns networking")
}
if len(p.CNINetworks) > 0 {
return errors.New("CNINetworks can only be used with Bridge mode networking")
diff --git a/pkg/specgen/podspecgen.go b/pkg/specgen/podspecgen.go
index 3c32ec365..7d771f5bb 100644
--- a/pkg/specgen/podspecgen.go
+++ b/pkg/specgen/podspecgen.go
@@ -134,6 +134,9 @@ type PodNetworkConfig struct {
// Conflicts with NoInfra=true and NoManageHosts.
// Optional.
HostAdd []string `json:"hostadd,omitempty"`
+ // NetworkOptions are additional options for each network
+ // Optional.
+ NetworkOptions map[string][]string `json:"network_options,omitempty"`
}
// PodCgroupConfig contains configuration options about a pod's cgroups.
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index 93186bc8b..f22a4c3af 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -27,7 +27,7 @@ var _ = Describe("Podman checkpoint", func() {
)
BeforeEach(func() {
- SkipIfRootless() //checkpoint not supported in rootless mode
+ SkipIfRootless("checkpoint not supported in rootless mode")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 1943020c3..f4c80d865 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -599,6 +599,24 @@ func (p *PodmanTestIntegration) CreateSeccompJson(in []byte) (string, error) {
return jsonFile, nil
}
+func SkipIfRootlessCgroupsV1(reason string) {
+ if len(reason) < 5 {
+ panic("SkipIfRootlessCgroupsV1 must specify a reason to skip")
+ }
+ if os.Geteuid() != 0 && !CGROUPSV2 {
+ Skip("[rootless]: " + reason)
+ }
+}
+
+func SkipIfRootless(reason string) {
+ if len(reason) < 5 {
+ panic("SkipIfRootless must specify a reason to skip")
+ }
+ if os.Geteuid() != 0 {
+ ginkgo.Skip("[rootless]: " + reason)
+ }
+}
+
func SkipIfNotFedora() {
info := GetHostDistributionInfo()
if info.Distribution != "fedora" {
@@ -610,21 +628,21 @@ func isRootless() bool {
return os.Geteuid() != 0
}
-func SkipIfCgroupV1() {
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
- if !cgroupsv2 {
- Skip("Skip on systems with cgroup V1 systems")
+func SkipIfCgroupV1(reason string) {
+ if len(reason) < 5 {
+ panic("SkipIfCgroupV1 must specify a reason to skip")
+ }
+ if !CGROUPSV2 {
+ Skip(reason)
}
}
-func SkipIfCgroupV2() {
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
- if cgroupsv2 {
- Skip("Skip on systems with cgroup V2 systems")
+func SkipIfCgroupV2(reason string) {
+ if len(reason) < 5 {
+ panic("SkipIfCgroupV2 must specify a reason to skip")
+ }
+ if CGROUPSV2 {
+ Skip(reason)
}
}
diff --git a/test/e2e/config.go b/test/e2e/config.go
index 0e1850614..49a47c7da 100644
--- a/test/e2e/config.go
+++ b/test/e2e/config.go
@@ -23,8 +23,4 @@ var (
// This image has a bogus/invalid seccomp profile which should
// yield a json error when being read.
alpineBogusSeccomp = "docker.io/libpod/alpine-with-bogus-seccomp:label"
-
- // v2fail is a temporary variable to help us track
- // tests that fail in v2
- v2fail = "does not pass integration tests with v2 podman"
)
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go
index 02c5d1428..965e51973 100644
--- a/test/e2e/containers_conf_test.go
+++ b/test/e2e/containers_conf_test.go
@@ -41,7 +41,7 @@ var _ = Describe("Podman run", func() {
})
It("podman run limits test", func() {
- SkipIfRootlessCgroupsV1()
+ SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
//containers.conf is set to "nofile=500:500"
session := podmanTest.Podman([]string{"run", "--rm", fedoraMinimal, "ulimit", "-n"})
session.WaitWithDefaultTimeout()
@@ -179,6 +179,12 @@ var _ = Describe("Podman run", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("1000"))
+
+ // Ignore containers.conf setting if --net=host
+ session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", fedoraMinimal, "cat", "/proc/sys/net/ipv4/ping_group_range"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).ToNot((ContainSubstring("1000")))
})
It("podman run containers.conf search domain", func() {
diff --git a/test/e2e/create_staticip_test.go b/test/e2e/create_staticip_test.go
index 57d1c3f2c..7a2267617 100644
--- a/test/e2e/create_staticip_test.go
+++ b/test/e2e/create_staticip_test.go
@@ -49,7 +49,7 @@ var _ = Describe("Podman create with --ip flag", func() {
})
It("Podman create --ip with non-allocatable IP", func() {
- SkipIfRootless() // --ip is not supported in rootless mode
+ SkipIfRootless("--ip is not supported in rootless mode")
result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "203.0.113.124", ALPINE, "ls"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -81,7 +81,7 @@ var _ = Describe("Podman create with --ip flag", func() {
})
It("Podman create two containers with the same IP", func() {
- SkipIfRootless() // --ip not supported in rootless mode
+ SkipIfRootless("--ip not supported in rootless mode")
ip := GetRandomIPAddress()
result := podmanTest.Podman([]string{"create", "--name", "test1", "--ip", ip, ALPINE, "sleep", "999"})
result.WaitWithDefaultTimeout()
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 45dbe9b56..e6491ce9b 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -552,7 +552,7 @@ var _ = Describe("Podman create", func() {
})
It("create container in pod with IP should fail", func() {
- SkipIfRootless() //Setting IP not supported in rootless mode
+ SkipIfRootless("Setting IP not supported in rootless mode")
name := "createwithstaticip"
pod := podmanTest.RunTopContainerInPod("", "new:"+name)
pod.WaitWithDefaultTimeout()
@@ -564,7 +564,7 @@ var _ = Describe("Podman create", func() {
})
It("create container in pod with mac should fail", func() {
- SkipIfRootless() //Setting MAC Address not supported in rootless mode
+ SkipIfRootless("Setting MAC Address not supported in rootless mode")
name := "createwithstaticmac"
pod := podmanTest.RunTopContainerInPod("", "new:"+name)
pod.WaitWithDefaultTimeout()
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go
index 0a0b2799b..fa87302ee 100644
--- a/test/e2e/libpod_suite_remote_test.go
+++ b/test/e2e/libpod_suite_remote_test.go
@@ -24,16 +24,10 @@ func IsRemote() bool {
}
func SkipIfRemote(reason string) {
- ginkgo.Skip("[remote]: " + reason)
-}
-
-func SkipIfRootlessCgroupsV1() {
-}
-
-func SkipIfRootless() {
- if os.Geteuid() != 0 {
- ginkgo.Skip("This function is not enabled for rootless podman")
+ if len(reason) < 5 {
+ panic("SkipIfRemote must specify a reason to skip")
}
+ ginkgo.Skip("[remote]: " + reason)
}
// Podman is the exec call to podman on the filesystem
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index 00d066fea..a9da922de 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -8,8 +8,6 @@ import (
"os"
"path/filepath"
"strings"
-
- . "github.com/onsi/ginkgo"
)
func IsRemote() bool {
@@ -19,18 +17,6 @@ func IsRemote() bool {
func SkipIfRemote(string) {
}
-func SkipIfRootlessCgroupsV1() {
- if os.Geteuid() != 0 && !CGROUPSV2 {
- Skip("Rooless requires cgroupsV2 to set limits")
- }
-}
-
-func SkipIfRootless() {
- if os.Geteuid() != 0 {
- Skip("This function is not enabled for rootless podman")
- }
-}
-
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
podmanSession := p.PodmanBase(args, false, false)
diff --git a/test/e2e/libpod_suite_varlink_test.go b/test/e2e/libpod_suite_varlink_test.go
index f901cbec9..275a1115e 100644
--- a/test/e2e/libpod_suite_varlink_test.go
+++ b/test/e2e/libpod_suite_varlink_test.go
@@ -23,19 +23,10 @@ func IsRemote() bool {
return true
}
-func SkipIfRootlessCgroupsV1() {
-}
-
func SkipIfRemote(reason string) {
ginkgo.Skip("[remote]: " + reason)
}
-func SkipIfRootless() {
- if os.Geteuid() != 0 {
- ginkgo.Skip("This function is not enabled for rootless podman")
- }
-}
-
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
podmanSession := p.PodmanBase(args, false, false)
diff --git a/test/e2e/login_logout_test.go b/test/e2e/login_logout_test.go
index 52357b00a..b1255c00a 100644
--- a/test/e2e/login_logout_test.go
+++ b/test/e2e/login_logout_test.go
@@ -47,7 +47,7 @@ var _ = Describe("Podman login and logout", func() {
se := SystemExec("setenforce", []string{"0"})
se.WaitWithDefaultTimeout()
if se.ExitCode() != 0 {
- Skip("Can not disable selinux, this may cause problem for reading cert files inside container.")
+ Skip("Cannot disable selinux, this may cause problem for reading cert files inside container.")
}
defer SystemExec("setenforce", []string{"1"})
}
@@ -87,7 +87,7 @@ var _ = Describe("Podman login and logout", func() {
Expect(session.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
})
@@ -116,8 +116,6 @@ var _ = Describe("Podman login and logout", func() {
})
It("podman login and logout without registry parameter", func() {
- SkipIfRootless()
-
registriesConf, err := ioutil.TempFile("", "TestLoginWithoutParameter")
Expect(err).To(BeNil())
defer registriesConf.Close()
@@ -231,7 +229,7 @@ var _ = Describe("Podman login and logout", func() {
Expect(session.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry1", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
session = podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", server})
diff --git a/test/e2e/mount_test.go b/test/e2e/mount_test.go
index 4f60cc6df..ee2753d72 100644
--- a/test/e2e/mount_test.go
+++ b/test/e2e/mount_test.go
@@ -18,7 +18,7 @@ var _ = Describe("Podman mount", func() {
)
BeforeEach(func() {
- SkipIfRootless()
+ SkipIfRootless("Podman mount requires podman unshare first to work")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -189,7 +189,7 @@ var _ = Describe("Podman mount", func() {
})
It("podman list running container", func() {
- SkipIfRootless() // FIXME: We need to do a podman unshare before executing this code.
+ SkipIfRootless("FIXME: We need to do a podman unshare before executing this code.")
setup := podmanTest.Podman([]string{"run", "-dt", ALPINE, "top"})
setup.WaitWithDefaultTimeout()
@@ -212,7 +212,7 @@ var _ = Describe("Podman mount", func() {
})
It("podman list multiple mounted containers", func() {
- SkipIfRootless() // FIXME: We need to do a podman unshare before executing this code.
+ SkipIfRootless("FIXME: We need to do a podman unshare before executing this code.")
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
setup.WaitWithDefaultTimeout()
@@ -257,7 +257,7 @@ var _ = Describe("Podman mount", func() {
})
It("podman list mounted container", func() {
- SkipIfRootless() // FIXME: We need to do a podman unshare before executing this code.
+ SkipIfRootless("FIXME: We need to do a podman unshare before executing this code.")
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
setup.WaitWithDefaultTimeout()
diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go
index f6d9f2cc3..a81ca19eb 100644
--- a/test/e2e/network_create_test.go
+++ b/test/e2e/network_create_test.go
@@ -178,7 +178,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with name and IPv6 subnet", func() {
- SkipIfRootless() // FIXME I believe this should work in rootlessmode
+ SkipIfRootless("FIXME I believe this should work in rootlessmode")
var (
results []network.NcList
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 2ea8291fc..35de95ed8 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -135,7 +135,7 @@ var _ = Describe("Podman network", func() {
})
It("podman network rm", func() {
- SkipIfRootless() // FIXME: This one is definitely broken in rootless mode
+ SkipIfRootless("FIXME: This one is definitely broken in rootless mode")
// Setup, use uuid to prevent conflict with other tests
uuid := stringid.GenerateNonCryptoID()
secondPath := filepath.Join(podmanTest.CNIConfigDir, fmt.Sprintf("%s.conflist", uuid))
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index a49304bbe..a90ffcc87 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -7,7 +7,6 @@ import (
"path/filepath"
"strings"
- "github.com/containers/podman/v2/pkg/cgroups"
. "github.com/containers/podman/v2/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -24,16 +23,13 @@ var _ = Describe("Podman pause", func() {
createdState := "created"
BeforeEach(func() {
- SkipIfRootlessCgroupsV1() // Pause is not supported in cgroups v1
+ SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
- if cgroupsv2 {
+ if CGROUPSV2 {
b, err := ioutil.ReadFile("/proc/self/cgroup")
if err != nil {
Skip("cannot read self cgroup")
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index ce0b51517..f69b6ca7b 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -416,4 +416,16 @@ entrypoint ["/fromimage"]
Expect(check2.ExitCode()).To(Equal(0))
Expect(check2.OutputToString()).To(Equal("/fromcommand:[/fromcommand]"))
})
+
+ It("podman create pod with slirp network option", func() {
+ name := "test"
+ session := podmanTest.Podman([]string{"pod", "create", "--name", name, "--network", "slirp4netns:port_handler=slirp4netns", "-p", "8082:8000"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ check := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{.InfraConfig.NetworkOptions.slirp4netns}}", name})
+ check.WaitWithDefaultTimeout()
+ Expect(check.ExitCode()).To(Equal(0))
+ Expect(check.OutputToString()).To(Equal("[port_handler=slirp4netns]"))
+ })
})
diff --git a/test/e2e/pod_pause_test.go b/test/e2e/pod_pause_test.go
index 182d99d51..3dabf7b4a 100644
--- a/test/e2e/pod_pause_test.go
+++ b/test/e2e/pod_pause_test.go
@@ -18,7 +18,7 @@ var _ = Describe("Podman pod pause", func() {
pausedState := "paused"
BeforeEach(func() {
- SkipIfRootlessCgroupsV1() // Pause is not supported in cgroups v1
+ SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go
index 02fb3bc57..1ffbe282b 100644
--- a/test/e2e/pod_stats_test.go
+++ b/test/e2e/pod_stats_test.go
@@ -17,7 +17,7 @@ var _ = Describe("Podman pod stats", func() {
BeforeEach(func() {
if os.Geteuid() != 0 {
- SkipIfCgroupV2()
+ SkipIfCgroupV2("--cgroup-manager=cgroupfs which doesn't work in rootless mode")
}
tempdir, err = CreateTempDirInTempDir()
@@ -175,7 +175,7 @@ var _ = Describe("Podman pod stats", func() {
It("podman stats on net=host post", func() {
// --net=host not supported for rootless pods at present
- SkipIfRootlessCgroupsV1() // Pause stats not supported in cgroups v1
+ SkipIfRootlessCgroupsV1("Pause stats not supported in cgroups v1")
podName := "testPod"
podCreate := podmanTest.Podman([]string{"pod", "create", "--net=host", "--name", podName})
podCreate.WaitWithDefaultTimeout()
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index aabec4f55..82a842146 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -206,7 +206,7 @@ var _ = Describe("Podman ps", func() {
})
It("podman ps namespace flag with go template format", func() {
- Skip(v2fail)
+ Skip("FIXME: table still not supported in podman ps command")
_, ec, _ := podmanTest.RunLsContainer("test1")
Expect(ec).To(Equal(0))
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go
index 9d2daaf9d..45b8769a2 100644
--- a/test/e2e/push_test.go
+++ b/test/e2e/push_test.go
@@ -70,7 +70,7 @@ var _ = Describe("Podman push", func() {
Expect(session.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
push := podmanTest.PodmanNoCache([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
@@ -87,7 +87,7 @@ var _ = Describe("Podman push", func() {
})
It("podman push to local registry with authorization", func() {
- SkipIfRootless() // FIXME: Creating content in certs.d we use directories in homedir
+ SkipIfRootless("FIXME: Creating content in certs.d we use directories in homedir")
if podmanTest.Host.Arch == "ppc64le" {
Skip("No registry image for ppc64le")
}
@@ -132,7 +132,7 @@ var _ = Describe("Podman push", func() {
Expect(session.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
session = podmanTest.PodmanNoCache([]string{"logs", "registry"})
diff --git a/test/e2e/run_cgroup_parent_test.go b/test/e2e/run_cgroup_parent_test.go
index b10937953..5765d5ef6 100644
--- a/test/e2e/run_cgroup_parent_test.go
+++ b/test/e2e/run_cgroup_parent_test.go
@@ -18,7 +18,7 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
)
BeforeEach(func() {
- SkipIfRootlessCgroupsV1() // cgroup parent is not supported in cgroups v1
+ SkipIfRootlessCgroupsV1("cgroup parent is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -48,7 +48,7 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
})
Specify("no --cgroup-parent", func() {
- SkipIfRootless() // FIXME This seems to be broken in rootless mode
+ SkipIfRootless("FIXME This seems to be broken in rootless mode")
cgroup := "/libpod_parent"
if !Containerized() && podmanTest.CgroupManager != "cgroupfs" {
cgroup = "/machine.slice"
diff --git a/test/e2e/run_cleanup_test.go b/test/e2e/run_cleanup_test.go
index 34b6ba4ff..5f6c9007a 100644
--- a/test/e2e/run_cleanup_test.go
+++ b/test/e2e/run_cleanup_test.go
@@ -34,7 +34,7 @@ var _ = Describe("Podman run exit", func() {
It("podman run -d mount cleanup test", func() {
SkipIfRemote("podman-remote does not support mount")
- SkipIfRootless() // FIXME podman mount requires podman unshare first
+ SkipIfRootless("FIXME podman mount requires podman unshare first")
result := podmanTest.Podman([]string{"run", "-dt", ALPINE, "top"})
result.WaitWithDefaultTimeout()
diff --git a/test/e2e/run_cpu_test.go b/test/e2e/run_cpu_test.go
index 86cc9d1c5..d8b57c230 100644
--- a/test/e2e/run_cpu_test.go
+++ b/test/e2e/run_cpu_test.go
@@ -4,7 +4,6 @@ import (
"io/ioutil"
"os"
- "github.com/containers/podman/v2/pkg/cgroups"
. "github.com/containers/podman/v2/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -18,17 +17,14 @@ var _ = Describe("Podman run cpu", func() {
)
BeforeEach(func() {
- SkipIfRootlessCgroupsV1()
+ SkipIfRootlessCgroupsV1("Setting CPU not supported on cgroupv1 for rootless users")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
- if cgroupsv2 {
+ if CGROUPSV2 {
if err := ioutil.WriteFile("/sys/fs/cgroup/cgroup.subtree_control", []byte("+cpuset"), 0644); err != nil {
Skip("cpuset controller not available on the current kernel")
}
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index 828da3494..1c2602631 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -72,7 +72,7 @@ var _ = Describe("Podman run device", func() {
})
It("podman run device host device and container device parameter are directories", func() {
- SkipIfRootless() // Can not create devices in /dev in rootless mode
+ SkipIfRootless("Cannot create devices in /dev in rootless mode")
Expect(os.MkdirAll("/dev/foodevdir", os.ModePerm)).To(BeNil())
defer os.RemoveAll("/dev/foodevdir")
diff --git a/test/e2e/run_memory_test.go b/test/e2e/run_memory_test.go
index a3dc9bae5..fa19b1824 100644
--- a/test/e2e/run_memory_test.go
+++ b/test/e2e/run_memory_test.go
@@ -3,7 +3,6 @@ package integration
import (
"os"
- "github.com/containers/podman/v2/pkg/cgroups"
. "github.com/containers/podman/v2/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -17,9 +16,9 @@ var _ = Describe("Podman run memory", func() {
)
BeforeEach(func() {
- SkipIfRootlessCgroupsV1()
+ SkipIfRootlessCgroupsV1("Setting Memory not supported on cgroupv1 for rootless users")
- SkipIfRootless()
+ SkipIfRootless("FIXME: This should work on cgroups V2 systems")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -37,12 +36,9 @@ var _ = Describe("Podman run memory", func() {
})
It("podman run memory test", func() {
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
var session *PodmanSessionIntegration
- if cgroupsv2 {
+ if CGROUPSV2 {
session = podmanTest.Podman([]string{"run", "--memory=40m", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/memory.max"})
} else {
session = podmanTest.Podman([]string{"run", "--memory=40m", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.limit_in_bytes"})
@@ -57,28 +53,21 @@ var _ = Describe("Podman run memory", func() {
Skip("Unable to perform test on Ubuntu distributions due to memory management")
}
- cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
- Expect(err).To(BeNil())
-
var session *PodmanSessionIntegration
- if cgroupsv2 {
- session = podmanTest.Podman([]string{"run", "--memory-reservation=40m", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/memory.high"})
+ if CGROUPSV2 {
+ session = podmanTest.Podman([]string{"run", "--memory-reservation=40m", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/memory.low"})
} else {
session = podmanTest.Podman([]string{"run", "--memory-reservation=40m", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.soft_limit_in_bytes"})
}
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- if cgroupsv2 {
- Expect(session.OutputToString()).To(Equal("max"))
- } else {
- Expect(session.OutputToString()).To(Equal("41943040"))
- }
+ Expect(session.OutputToString()).To(Equal("41943040"))
})
It("podman run memory-swappiness test", func() {
- SkipIfCgroupV2()
+ SkipIfCgroupV2("memory-swappiness not supported on cgroupV2")
session := podmanTest.Podman([]string{"run", "--memory-swappiness=15", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.swappiness"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -86,8 +75,18 @@ var _ = Describe("Podman run memory", func() {
})
It("podman run kernel-memory test", func() {
- SkipIfCgroupV2()
- session := podmanTest.Podman([]string{"run", "--kernel-memory=40m", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes"})
+ if podmanTest.Host.Distribution == "ubuntu" {
+ Skip("Unable to perform test on Ubuntu distributions due to memory management")
+ }
+
+ var session *PodmanSessionIntegration
+
+ if CGROUPSV2 {
+ session = podmanTest.Podman([]string{"run", "--memory-reservation=40m", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/memory.low"})
+ } else {
+ session = podmanTest.Podman([]string{"run", "--memory-reservation=40m", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.soft_limit_in_bytes"})
+ }
+
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Equal("41943040"))
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index a67324b2b..044e56e6c 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -55,7 +55,7 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run network expose port 222", func() {
- SkipIfRootless() // iptables is not supported for rootless users
+ SkipIfRootless("iptables is not supported for rootless users")
session := podmanTest.Podman([]string{"run", "-dt", "--expose", "222-223", "-P", ALPINE, "/bin/sh"})
session.Wait(30)
Expect(session.ExitCode()).To(Equal(0))
@@ -252,7 +252,7 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run network expose host port 80 to container port 8000", func() {
- SkipIfRootless() // iptables is not supported for rootless users
+ SkipIfRootless("iptables is not supported for rootless users")
session := podmanTest.Podman([]string{"run", "-dt", "-p", "80:8000", ALPINE, "/bin/sh"})
session.Wait(30)
Expect(session.ExitCode()).To(Equal(0))
@@ -367,7 +367,7 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run network expose duplicate host port results in error", func() {
- SkipIfRootless() // FIXME we should be able to run this test in rootless mode with different ports
+ SkipIfRootless("FIXME we should be able to run this test in rootless mode with different ports")
session := podmanTest.Podman([]string{"run", "--name", "test", "-dt", "-p", "80", ALPINE, "/bin/sh"})
session.WaitWithDefaultTimeout()
@@ -478,9 +478,9 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run network in user created network namespace", func() {
- SkipIfRootless() // ip netns is not supported for rootless users
+ SkipIfRootless("ip netns is not supported for rootless users")
if Containerized() {
- Skip("Can not be run within a container.")
+ Skip("Cannot be run within a container.")
}
addXXX := SystemExec("ip", []string{"netns", "add", "xxx"})
Expect(addXXX.ExitCode()).To(Equal(0))
@@ -495,9 +495,9 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run n user created network namespace with resolv.conf", func() {
- SkipIfRootless() // ip netns is not supported for rootless users
+ SkipIfRootless("ip netns is not supported for rootless users")
if Containerized() {
- Skip("Can not be run within a container.")
+ Skip("Cannot be run within a container.")
}
addXXX2 := SystemExec("ip", []string{"netns", "add", "xxx2"})
Expect(addXXX2.ExitCode()).To(Equal(0))
@@ -527,7 +527,7 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run in custom CNI network with --static-ip", func() {
- SkipIfRootless() //Rootless mode does not support --ip
+ SkipIfRootless("Rootless mode does not support --ip")
netName := "podmantestnetwork"
ipAddr := "10.25.30.128"
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.30.0/24", netName})
@@ -542,7 +542,7 @@ var _ = Describe("Podman run networking", func() {
})
It("podman run with new:pod and static-ip", func() {
- SkipIfRootless() // Rootless does not support --ip
+ SkipIfRootless("Rootless does not support --ip")
netName := "podmantestnetwork2"
ipAddr := "10.25.40.128"
podname := "testpod"
diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go
index a20088776..ab11128ba 100644
--- a/test/e2e/run_privileged_test.go
+++ b/test/e2e/run_privileged_test.go
@@ -106,7 +106,7 @@ var _ = Describe("Podman privileged container tests", func() {
})
It("podman privileged should inherit host devices", func() {
- SkipIfRootless() // FIXME: This seems to be broken for rootless mode, /dev/ is close to the same
+ SkipIfRootless("FIXME: This seems to be broken for rootless mode, /dev/ is close to the same")
session := podmanTest.Podman([]string{"run", "--privileged", ALPINE, "ls", "-l", "/dev"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index 959c823b5..8383b1812 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -19,7 +19,7 @@ var _ = Describe("Podman run with --ip flag", func() {
)
BeforeEach(func() {
- SkipIfRootless() //rootless does not support --ip
+ SkipIfRootless("rootless does not support --ip")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 5c28f18f2..2d4f3a42d 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -309,7 +309,7 @@ USER bin`
})
It("podman run limits test", func() {
- SkipIfRootlessCgroupsV1()
+ SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
if !isRootless() {
session := podmanTest.Podman([]string{"run", "--rm", "--ulimit", "rtprio=99", "--cap-add=sys_nice", fedoraMinimal, "cat", "/proc/self/sched"})
@@ -368,16 +368,21 @@ USER bin`
})
It("podman run sysctl test", func() {
- SkipIfRootless() // Network sysclts are not avalable root rootless
+ SkipIfRootless("Network sysctls are not avalable root rootless")
session := podmanTest.Podman([]string{"run", "--rm", "--sysctl", "net.core.somaxconn=65535", ALPINE, "sysctl", "net.core.somaxconn"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("net.core.somaxconn = 65535"))
+
+ // network sysctls should fail if --net=host is set
+ session = podmanTest.Podman([]string{"run", "--net", "host", "--rm", "--sysctl", "net.core.somaxconn=65535", ALPINE, "sysctl", "net.core.somaxconn"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
})
It("podman run blkio-weight test", func() {
- SkipIfRootless() // FIXME: This is blowing up because of no /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control file
- // SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME: This is blowing up because of no /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control file")
+ SkipIfRootlessCgroupsV1("Setting blkio-weight not supported on cgroupv1 for rootless users")
if !CGROUPSV2 {
if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) {
Skip("Kernel does not support blkio.weight")
@@ -399,8 +404,9 @@ USER bin`
})
It("podman run device-read-bps test", func() {
- SkipIfRootless() // FIXME: Missing /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control
- SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME: Missing /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control")
+ SkipIfRootlessCgroupsV1("Setting device-read-bps not supported on cgroupv1 for rootless users")
+
var session *PodmanSessionIntegration
if CGROUPSV2 {
@@ -417,8 +423,9 @@ USER bin`
})
It("podman run device-write-bps test", func() {
- SkipIfRootless() // FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist
- SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist")
+ SkipIfRootlessCgroupsV1("Setting device-write-bps not supported on cgroupv1 for rootless users")
+
var session *PodmanSessionIntegration
if CGROUPSV2 {
@@ -434,8 +441,8 @@ USER bin`
})
It("podman run device-read-iops test", func() {
- SkipIfRootless() // FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist
- SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist")
+ SkipIfRootlessCgroupsV1("Setting device-read-iops not supported on cgroupv1 for rootless users")
var session *PodmanSessionIntegration
if CGROUPSV2 {
@@ -452,8 +459,8 @@ USER bin`
})
It("podman run device-write-iops test", func() {
- SkipIfRootless() // FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist
- SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control does not exist")
+ SkipIfRootlessCgroupsV1("Setting device-write-iops not supported on cgroupv1 for rootless users")
var session *PodmanSessionIntegration
if CGROUPSV2 {
@@ -570,7 +577,7 @@ USER bin`
})
It("podman run with FIPS mode secrets", func() {
- SkipIfRootless() // rootless can not manipulate system-fips file
+ SkipIfRootless("rootless can not manipulate system-fips file")
fipsFile := "/etc/system-fips"
err = ioutil.WriteFile(fipsFile, []byte{}, 0755)
Expect(err).To(BeNil())
@@ -889,7 +896,7 @@ USER mail`
})
It("podman run --mount type=bind,bind-nonrecursive", func() {
- SkipIfRootless() // rootless users are not allowed to mount bind-nonrecursive (Could this be a Kernel bug?
+ SkipIfRootless("FIXME: rootless users are not allowed to mount bind-nonrecursive (Could this be a Kernel bug?")
session := podmanTest.Podman([]string{"run", "--mount", "type=bind,bind-nonrecursive,slave,src=/,target=/host", fedoraMinimal, "findmnt", "-nR", "/host"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -1049,8 +1056,8 @@ USER mail`
})
It("podman run with cgroups=disabled runs without cgroups", func() {
- SkipIfRootless() // FIXME: I believe this should work but need to fix this test
- SkipIfRootlessCgroupsV1()
+ SkipIfRootless("FIXME: I believe this should work but need to fix this test")
+ SkipIfRootlessCgroupsV1("Disable cgroups not supported on cgroupv1 for rootless users")
// Only works on crun
if !strings.Contains(podmanTest.OCIRuntime, "crun") {
Skip("Test only works on crun")
@@ -1082,7 +1089,7 @@ USER mail`
})
It("podman run with cgroups=enabled makes cgroups", func() {
- SkipIfRootlessCgroupsV1()
+ SkipIfRootlessCgroupsV1("Enable cgroups not supported on cgroupv1 for rootless users")
// Only works on crun
if !strings.Contains(podmanTest.OCIRuntime, "crun") {
Skip("Test only works on crun")
@@ -1125,7 +1132,7 @@ USER mail`
})
It("podman run --device-cgroup-rule", func() {
- SkipIfRootless() // rootless users are not allowed to mknod
+ SkipIfRootless("rootless users are not allowed to mknod")
deviceCgroupRule := "c 42:* rwm"
session := podmanTest.Podman([]string{"run", "--name", "test", "-d", "--device-cgroup-rule", deviceCgroupRule, ALPINE, "top"})
session.WaitWithDefaultTimeout()
@@ -1203,7 +1210,7 @@ USER mail`
})
It("podman run verify pids-limit", func() {
- SkipIfCgroupV1()
+ SkipIfCgroupV1("pids-limit not supported on cgroup V1")
limit := "4321"
session := podmanTest.Podman([]string{"run", "--pids-limit", limit, "--rm", ALPINE, "cat", "/sys/fs/cgroup/pids.max"})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index fc9245e62..92d3418e3 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -227,7 +227,7 @@ var _ = Describe("Podman run with volumes", func() {
})
It("podman run with tmpfs named volume mounts and unmounts", func() {
- SkipIfRootless() // FIXME: rootless podman mount requires you to be in a user namespace
+ SkipIfRootless("FIXME: rootless podman mount requires you to be in a user namespace")
SkipIfRemote("podman-remote does not support --volumes this test could be simplified to be tested on Remote.")
volName := "testvol"
mkVolume := podmanTest.Podman([]string{"volume", "create", "--opt", "type=tmpfs", "--opt", "device=tmpfs", "--opt", "o=nodev", "testvol"})
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index a3d56ad89..19365909d 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -186,7 +186,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(fakereg.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
search := podmanTest.Podman([]string{"search",
@@ -213,7 +213,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registry.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry3", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
podmanTest.RestoreArtifact(ALPINE)
@@ -250,7 +250,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registry.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry4", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
podmanTest.RestoreArtifact(ALPINE)
@@ -290,7 +290,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registry.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry5", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
podmanTest.RestoreArtifact(ALPINE)
@@ -329,7 +329,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registry.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry6", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
podmanTest.RestoreArtifact(ALPINE)
@@ -371,7 +371,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registryLocal.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry7", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
registryLocal = podmanTest.Podman([]string{"run", "-d", "-p", "6000:5000", "--name", "registry8", registry})
@@ -379,7 +379,7 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(registryLocal.ExitCode()).To(Equal(0))
if !WaitContainerReady(podmanTest, "registry8", "listening on", 20, 1) {
- Skip("Can not start docker registry.")
+ Skip("Cannot start docker registry.")
}
podmanTest.RestoreArtifact(ALPINE)
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index 7ab435007..c8f5efa9d 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -21,9 +21,7 @@ var _ = Describe("Podman stats", func() {
)
BeforeEach(func() {
- if os.Geteuid() != 0 {
- SkipIfCgroupV1()
- }
+ SkipIfRootlessCgroupsV1("stats not supported on cgroupv1 for rootless users")
var err error
tempdir, err = CreateTempDirInTempDir()
if err != nil {
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index 8ef1e3ac7..4be8443e3 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -47,7 +47,7 @@ WantedBy=multi-user.target
})
It("podman start container by systemd", func() {
- SkipIfRootless() // rootless can not write to /etc
+ SkipIfRootless("rootless can not write to /etc")
if os.Getenv("SKIP_USERNS") != "" {
Skip("Skip userns tests.")
}
diff --git a/test/e2e/tree_test.go b/test/e2e/tree_test.go
index c6eb0a6eb..eeb00440c 100644
--- a/test/e2e/tree_test.go
+++ b/test/e2e/tree_test.go
@@ -34,9 +34,7 @@ var _ = Describe("Podman image tree", func() {
})
It("podman image tree", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote("Does not work on remote client")
dockerfile := `FROM docker.io/library/busybox:latest
RUN mkdir hello
RUN touch test.txt
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index 377b721d0..4a2c2d324 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -56,7 +56,7 @@ var _ = Describe("Podman volume ls", func() {
})
It("podman ls volume with Go template", func() {
- Skip(v2fail)
+ Skip("FIXME: table still not supported in podman volume command")
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 4a286d3ae..eb740f04b 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -14,7 +14,7 @@ load helpers
# ...but check the configured runtime engine, and switch to crun as needed
run_podman info --format '{{ .Host.OCIRuntime.Path }}'
if expr "$output" : ".*/crun"; then
- err_no_such_cmd="Error: executable file not found in \$PATH: No such file or directory: OCI runtime command not found error"
+ err_no_such_cmd="Error: executable file.* not found in \$PATH: No such file or directory: OCI runtime command not found error"
err_no_exec_dir="Error: open executable: Operation not permitted: OCI runtime permission denied error"
fi
@@ -153,8 +153,23 @@ echo $rand | 0 | $rand
run_podman run --pull=always $NONLOCAL_IMAGE true
is "$output" "Trying to pull .*" "--pull=always [with image PRESENT]: re-fetches"
+ # Very weird corner case fixed by #7770: 'podman run foo' will run 'myfoo'
+ # if it exists, because the string 'foo' appears in 'myfoo'. This test
+ # covers that, as well as making sure that our testimage (which is always
+ # tagged :YYYYMMDD, never :latest) doesn't match either.
+ run_podman tag $IMAGE my${PODMAN_TEST_IMAGE_NAME}:latest
+ run_podman 125 run --pull=never $PODMAN_TEST_IMAGE_NAME true
+ is "$output" "Error: unable to find a name and tag match for $PODMAN_TEST_IMAGE_NAME in repotags: no such image" \
+ "podman run --pull=never with shortname (and implicit :latest)"
+
+ # ...but if we add a :latest tag (without 'my'), it should now work
+ run_podman tag $IMAGE ${PODMAN_TEST_IMAGE_NAME}:latest
+ run_podman run --pull=never ${PODMAN_TEST_IMAGE_NAME} cat /home/podman/testimage-id
+ is "$output" "$PODMAN_TEST_IMAGE_TAG" \
+ "podman run --pull=never, with shortname, succeeds if img is present"
+
run_podman rm -a
- run_podman rmi $NONLOCAL_IMAGE
+ run_podman rmi $NONLOCAL_IMAGE {my,}${PODMAN_TEST_IMAGE_NAME}:latest
}
# 'run --rmi' deletes the image in the end unless it's used by another container
@@ -393,4 +408,28 @@ json-file | f
run_podman rm myctr
}
+@test "podman run --tz" {
+ # This file will always have a constant reference timestamp
+ local testfile=/home/podman/testimage-id
+
+ run_podman run --rm $IMAGE date -r $testfile
+ is "$output" "Sun Sep 13 12:26:40 UTC 2020" "podman run with no TZ"
+
+ run_podman run --rm --tz=MST7MDT $IMAGE date -r $testfile
+ is "$output" "Sun Sep 13 06:26:40 MDT 2020" "podman run with --tz=MST7MDT"
+
+ # --tz=local pays attention to /etc/localtime, not $TZ. We set TZ anyway,
+ # to make sure podman ignores it; and, because this test is locale-
+ # dependent, we pick an obscure zone (+1245) that is unlikely to
+ # collide with any of our testing environments.
+ #
+ # To get a reference timestamp we run 'date' locally; note the explicit
+ # strftime() format. We can't use --iso=seconds because GNU date adds
+ # a colon to the TZ offset (eg -07:00) whereas alpine does not (-0700).
+ run date --date=@1600000000 +%Y-%m-%dT%H:%M:%S%z
+ expect="$output"
+ TZ=Pacific/Chatham run_podman run --rm --tz=local $IMAGE date -Iseconds -r $testfile
+ is "$output" "$expect" "podman run with --tz=local, matches host"
+}
+
# vim: filetype=sh
diff --git a/test/system/build-testimage b/test/system/build-testimage
index ef14d3afd..53ade57f0 100755
--- a/test/system/build-testimage
+++ b/test/system/build-testimage
@@ -35,6 +35,12 @@ cd $tmpdir
# 'image mount' test will confirm that this file exists and has our YMD tag
echo $YMD >testimage-id
+# ...but set the timestamp on the file itself to a constant well-known
+# value, for use by the 'run --tz' test. Date value chosen for nerdiness
+# and because it's in the past. (Much as I'd love FFFFFFFF, we can't
+# use any future date because of unpredictable leap second adjustments).
+touch --date=@1600000000 testimage-id
+
# 'pod' test will use this for --infra-command
cat >pause <<EOF
#!/bin/sh
@@ -49,6 +55,7 @@ EOF
chmod 755 pause
# alpine because it's small and light and reliable
+# - check for updates @ https://hub.docker.com/_/alpine
# busybox-extras provides httpd needed in 500-networking.bats
cat >Containerfile <<EOF
FROM docker.io/library/alpine:3.12.0
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index eb3e4c7ec..998db5283 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -7,7 +7,7 @@ PODMAN=${PODMAN:-podman}
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"}
-PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20200917"}
+PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20200929"}
PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG"
# Because who wants to spell that out each time?
diff --git a/transfer.md b/transfer.md
index 49ff687e6..8ead43f63 100644
--- a/transfer.md
+++ b/transfer.md
@@ -89,6 +89,14 @@ There are other equivalents for these tools
**** Use mount to take advantage of the entire linux tool chain rather then just cp. Read [`here`](./docs/podman-cp.1.md) for more information.
+## Behavioural differences and pitfalls
+
+These commands behave differently from the commands in Docker:
+
+| Command | Description |
+| :--- | :--- |
+| `podman volume create` | While `docker volume create` is idempotent, `podman volume create` raises an error if the volume does already exist. See this [docker issue](https://github.com/moby/moby/issues/16068) for more information.|
+
## Missing commands in podman
Those Docker commands currently do not have equivalents in `podman`:
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE b/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
deleted file mode 100644
index 14127cd83..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
+++ /dev/null
@@ -1,9 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
deleted file mode 100644
index 09a4a35c9..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Windows Terminal Sequences
-
-This library allow for enabling Windows terminal color support for Go.
-
-See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details.
-
-## Usage
-
-```go
-import (
- "syscall"
-
- sequences "github.com/konsorten/go-windows-terminal-sequences"
-)
-
-func main() {
- sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true)
-}
-
-```
-
-## Authors
-
-The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de).
-
-We thank all the authors who provided code to this library:
-
-* Felix Kollmann
-* Nicolas Perraut
-* @dirty49374
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod b/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
deleted file mode 100644
index 716c61312..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module github.com/konsorten/go-windows-terminal-sequences
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
deleted file mode 100644
index 57f530ae8..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// +build windows
-
-package sequences
-
-import (
- "syscall"
-)
-
-var (
- kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll")
- setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode")
-)
-
-func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
- const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4
-
- var mode uint32
- err := syscall.GetConsoleMode(syscall.Stdout, &mode)
- if err != nil {
- return err
- }
-
- if enable {
- mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- } else {
- mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
- }
-
- ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode))
- if ret == 0 {
- return err
- }
-
- return nil
-}
diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go
deleted file mode 100644
index df61a6f2f..000000000
--- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build linux darwin
-
-package sequences
-
-import (
- "fmt"
-)
-
-func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error {
- return fmt.Errorf("windows only package")
-}
diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore
index 6b7d7d1e8..1fb13abeb 100644
--- a/vendor/github.com/sirupsen/logrus/.gitignore
+++ b/vendor/github.com/sirupsen/logrus/.gitignore
@@ -1,2 +1,4 @@
logrus
vendor
+
+.idea/
diff --git a/vendor/github.com/sirupsen/logrus/buffer_pool.go b/vendor/github.com/sirupsen/logrus/buffer_pool.go
new file mode 100644
index 000000000..4545dec07
--- /dev/null
+++ b/vendor/github.com/sirupsen/logrus/buffer_pool.go
@@ -0,0 +1,52 @@
+package logrus
+
+import (
+ "bytes"
+ "sync"
+)
+
+var (
+ bufferPool BufferPool
+)
+
+type BufferPool interface {
+ Put(*bytes.Buffer)
+ Get() *bytes.Buffer
+}
+
+type defaultPool struct {
+ pool *sync.Pool
+}
+
+func (p *defaultPool) Put(buf *bytes.Buffer) {
+ p.pool.Put(buf)
+}
+
+func (p *defaultPool) Get() *bytes.Buffer {
+ return p.pool.Get().(*bytes.Buffer)
+}
+
+func getBuffer() *bytes.Buffer {
+ return bufferPool.Get()
+}
+
+func putBuffer(buf *bytes.Buffer) {
+ buf.Reset()
+ bufferPool.Put(buf)
+}
+
+// SetBufferPool allows to replace the default logrus buffer pool
+// to better meets the specific needs of an application.
+func SetBufferPool(bp BufferPool) {
+ bufferPool = bp
+}
+
+func init() {
+ SetBufferPool(&defaultPool{
+ pool: &sync.Pool{
+ New: func() interface{} {
+ return new(bytes.Buffer)
+ },
+ },
+ })
+}
diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go
index f6e062a34..5a5cbfe7c 100644
--- a/vendor/github.com/sirupsen/logrus/entry.go
+++ b/vendor/github.com/sirupsen/logrus/entry.go
@@ -13,7 +13,6 @@ import (
)
var (
- bufferPool *sync.Pool
// qualified package name, cached at first use
logrusPackage string
@@ -31,12 +30,6 @@ const (
)
func init() {
- bufferPool = &sync.Pool{
- New: func() interface{} {
- return new(bytes.Buffer)
- },
- }
-
// start at the bottom of the stack before the package-name cache is primed
minimumCallerDepth = 1
}
@@ -243,9 +236,12 @@ func (entry Entry) log(level Level, msg string) {
entry.fireHooks()
- buffer = bufferPool.Get().(*bytes.Buffer)
+ buffer = getBuffer()
+ defer func() {
+ entry.Buffer = nil
+ putBuffer(buffer)
+ }()
buffer.Reset()
- defer bufferPool.Put(buffer)
entry.Buffer = buffer
entry.write()
diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go
index 42b04f6c8..017c30ce6 100644
--- a/vendor/github.com/sirupsen/logrus/exported.go
+++ b/vendor/github.com/sirupsen/logrus/exported.go
@@ -134,6 +134,51 @@ func Fatal(args ...interface{}) {
std.Fatal(args...)
}
+// TraceFn logs a message from a func at level Trace on the standard logger.
+func TraceFn(fn LogFunction) {
+ std.TraceFn(fn)
+}
+
+// DebugFn logs a message from a func at level Debug on the standard logger.
+func DebugFn(fn LogFunction) {
+ std.DebugFn(fn)
+}
+
+// PrintFn logs a message from a func at level Info on the standard logger.
+func PrintFn(fn LogFunction) {
+ std.PrintFn(fn)
+}
+
+// InfoFn logs a message from a func at level Info on the standard logger.
+func InfoFn(fn LogFunction) {
+ std.InfoFn(fn)
+}
+
+// WarnFn logs a message from a func at level Warn on the standard logger.
+func WarnFn(fn LogFunction) {
+ std.WarnFn(fn)
+}
+
+// WarningFn logs a message from a func at level Warn on the standard logger.
+func WarningFn(fn LogFunction) {
+ std.WarningFn(fn)
+}
+
+// ErrorFn logs a message from a func at level Error on the standard logger.
+func ErrorFn(fn LogFunction) {
+ std.ErrorFn(fn)
+}
+
+// PanicFn logs a message from a func at level Panic on the standard logger.
+func PanicFn(fn LogFunction) {
+ std.PanicFn(fn)
+}
+
+// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.
+func FatalFn(fn LogFunction) {
+ std.FatalFn(fn)
+}
+
// Tracef logs a message at level Trace on the standard logger.
func Tracef(format string, args ...interface{}) {
std.Tracef(format, args...)
diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod
index d41329679..b3919d5ea 100644
--- a/vendor/github.com/sirupsen/logrus/go.mod
+++ b/vendor/github.com/sirupsen/logrus/go.mod
@@ -2,10 +2,9 @@ module github.com/sirupsen/logrus
require (
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/konsorten/go-windows-terminal-sequences v1.0.3
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.2.2
- golang.org/x/sys v0.0.0-20190422165155-953cdadca894
+ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
)
go 1.13
diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum
index 49c690f23..1edc143be 100644
--- a/vendor/github.com/sirupsen/logrus/go.sum
+++ b/vendor/github.com/sirupsen/logrus/go.sum
@@ -1,12 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go
index 6fdda748e..dbf627c97 100644
--- a/vendor/github.com/sirupsen/logrus/logger.go
+++ b/vendor/github.com/sirupsen/logrus/logger.go
@@ -9,6 +9,11 @@ import (
"time"
)
+// LogFunction For big messages, it can be more efficient to pass a function
+// and only call it if the log level is actually enables rather than
+// generating the log message and then checking if the level is enabled
+type LogFunction func()[]interface{}
+
type Logger struct {
// The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
// file, or leave it default which is `os.Stderr`. You can also set this to
@@ -70,7 +75,7 @@ func (mw *MutexWrap) Disable() {
//
// var log = &logrus.Logger{
// Out: os.Stderr,
-// Formatter: new(logrus.JSONFormatter),
+// Formatter: new(logrus.TextFormatter),
// Hooks: make(logrus.LevelHooks),
// Level: logrus.DebugLevel,
// }
@@ -195,6 +200,14 @@ func (logger *Logger) Log(level Level, args ...interface{}) {
}
}
+func (logger *Logger) LogFn(level Level, fn LogFunction) {
+ if logger.IsLevelEnabled(level) {
+ entry := logger.newEntry()
+ entry.Log(level, fn()...)
+ logger.releaseEntry(entry)
+ }
+}
+
func (logger *Logger) Trace(args ...interface{}) {
logger.Log(TraceLevel, args...)
}
@@ -234,6 +247,45 @@ func (logger *Logger) Panic(args ...interface{}) {
logger.Log(PanicLevel, args...)
}
+func (logger *Logger) TraceFn(fn LogFunction) {
+ logger.LogFn(TraceLevel, fn)
+}
+
+func (logger *Logger) DebugFn(fn LogFunction) {
+ logger.LogFn(DebugLevel, fn)
+}
+
+func (logger *Logger) InfoFn(fn LogFunction) {
+ logger.LogFn(InfoLevel, fn)
+}
+
+func (logger *Logger) PrintFn(fn LogFunction) {
+ entry := logger.newEntry()
+ entry.Print(fn()...)
+ logger.releaseEntry(entry)
+}
+
+func (logger *Logger) WarnFn(fn LogFunction) {
+ logger.LogFn(WarnLevel, fn)
+}
+
+func (logger *Logger) WarningFn(fn LogFunction) {
+ logger.WarnFn(fn)
+}
+
+func (logger *Logger) ErrorFn(fn LogFunction) {
+ logger.LogFn(ErrorLevel, fn)
+}
+
+func (logger *Logger) FatalFn(fn LogFunction) {
+ logger.LogFn(FatalLevel, fn)
+ logger.Exit(1)
+}
+
+func (logger *Logger) PanicFn(fn LogFunction) {
+ logger.LogFn(PanicLevel, fn)
+}
+
func (logger *Logger) Logln(level Level, args ...interface{}) {
if logger.IsLevelEnabled(level) {
entry := logger.newEntry()
diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
index 572889db2..2879eb50e 100644
--- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
+++ b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
@@ -5,30 +5,23 @@ package logrus
import (
"io"
"os"
- "syscall"
- sequences "github.com/konsorten/go-windows-terminal-sequences"
+ "golang.org/x/sys/windows"
)
-func initTerminal(w io.Writer) {
- switch v := w.(type) {
- case *os.File:
- sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
- }
-}
-
func checkIfTerminal(w io.Writer) bool {
- var ret bool
switch v := w.(type) {
case *os.File:
+ handle := windows.Handle(v.Fd())
var mode uint32
- err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
- ret = (err == nil)
- default:
- ret = false
- }
- if ret {
- initTerminal(w)
+ if err := windows.GetConsoleMode(handle, &mode); err != nil {
+ return false
+ }
+ mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
+ if err := windows.SetConsoleMode(handle, mode); err != nil {
+ return false
+ }
+ return true
}
- return ret
+ return false
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index e3f3712c2..f9556549b 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -340,8 +340,6 @@ github.com/klauspost/compress/zstd
github.com/klauspost/compress/zstd/internal/xxhash
# github.com/klauspost/pgzip v1.2.5
github.com/klauspost/pgzip
-# github.com/konsorten/go-windows-terminal-sequences v1.0.3
-github.com/konsorten/go-windows-terminal-sequences
# github.com/mattn/go-runewidth v0.0.9
github.com/mattn/go-runewidth
# github.com/mattn/go-shellwords v1.0.10
@@ -494,7 +492,7 @@ github.com/rootless-containers/rootlesskit/pkg/port/portutil
github.com/safchain/ethtool
# github.com/seccomp/libseccomp-golang v0.9.2-0.20200616122406-847368b35ebf
github.com/seccomp/libseccomp-golang
-# github.com/sirupsen/logrus v1.6.0
+# github.com/sirupsen/logrus v1.7.0
github.com/sirupsen/logrus
github.com/sirupsen/logrus/hooks/syslog
# github.com/spf13/cobra v1.0.0