github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/integration/graph/vfs_test.go (about)

     1  package graph_test
     2  
     3  import (
     4  	. "github.com/onsi/ginkgo"
     5  	. "github.com/onsi/gomega"
     6  	"github.com/onsi/gomega/gbytes"
     7  
     8  	"github.com/cloudfoundry-incubator/garden"
     9  )
    10  
    11  var _ = Describe("VFS", func() {
    12  	var container garden.Container
    13  
    14  	BeforeEach(func() {
    15  		client = startGarden("-graphDriver", "vfs")
    16  	})
    17  
    18  	It("logs a warning on start", func() {
    19  		Eventually(client.Buffer).Should(gbytes.Say("unsupported-graph-driver.*vfs"))
    20  	})
    21  
    22  	Describe("a privileged container", func() {
    23  		JustBeforeEach(func() {
    24  			var err error
    25  			container, err = client.Create(garden.ContainerSpec{
    26  				RootFSPath: rootFSPath,
    27  				Privileged: true,
    28  			})
    29  			Expect(err).ToNot(HaveOccurred())
    30  		})
    31  
    32  		It("can run a process", func() {
    33  			process, err := container.Run(garden.ProcessSpec{
    34  				User: "root",
    35  				Path: "true",
    36  			}, garden.ProcessIO{Stdout: GinkgoWriter, Stderr: GinkgoWriter})
    37  			Expect(err).ToNot(HaveOccurred())
    38  
    39  			Expect(process.Wait()).To(Equal(0))
    40  		})
    41  	})
    42  
    43  	Describe("an unprivileged container", func() {
    44  		JustBeforeEach(func() {
    45  			var err error
    46  			container, err = client.Create(garden.ContainerSpec{
    47  				RootFSPath: rootFSPath,
    48  				Privileged: false,
    49  			})
    50  			Expect(err).ToNot(HaveOccurred())
    51  		})
    52  
    53  		It("can run a process", func() {
    54  			process, err := container.Run(garden.ProcessSpec{
    55  				User: "root",
    56  				Path: "true",
    57  			}, garden.ProcessIO{Stdout: GinkgoWriter, Stderr: GinkgoWriter})
    58  			Expect(err).ToNot(HaveOccurred())
    59  
    60  			Expect(process.Wait()).To(Equal(0))
    61  		})
    62  	})
    63  })