github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/integration/docker/top_test.go (about)

     1  // Copyright (c) 2018 Intel Corporation
     2  //
     3  // SPDX-License-Identifier: Apache-2.0
     4  
     5  package docker
     6  
     7  import (
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  var _ = Describe("docker top", func() {
    13  	var (
    14  		id       string
    15  		stdout   string
    16  		workload string
    17  		exitCode int
    18  	)
    19  
    20  	BeforeEach(func() {
    21  		id = randomDockerName()
    22  		workload = "sleep 10"
    23  		_, _, exitCode = dockerRun("--name", id, "-d", Image, "sh", "-c", workload)
    24  		Expect(exitCode).To(Equal(0))
    25  	})
    26  
    27  	AfterEach(func() {
    28  		Expect(RemoveDockerContainer(id)).To(BeTrue())
    29  		Expect(ExistDockerContainer(id)).NotTo(BeTrue())
    30  	})
    31  
    32  	Context("check docker top functionality", func() {
    33  		It("should print usage statement", func() {
    34  			Skip("Issue: https://github.com/clearcontainers/runtime/issues/876")
    35  			stdout, _, exitCode = dockerTop(id, "-x")
    36  			Expect(exitCode).To(Equal(0))
    37  			Expect(stdout).To(ContainSubstring(workload))
    38  		})
    39  	})
    40  })