Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to CSI 1.0 #122

Merged
merged 7 commits into from
Nov 29, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix race condition in sanity checks
  • Loading branch information
bertinatto committed Nov 22, 2018
commit ff25c76ed2f9d83b0862bae94f5062a7afe20d62
54 changes: 24 additions & 30 deletions tests/sanity/sanity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,42 @@ import (
. "github.com/onsi/gomega"

sanity "github.com/kubernetes-csi/csi-test/pkg/sanity"

"github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud"
"github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver"
)

const (
mountPath = "/tmp/csi/mount"
stagePath = "/tmp/csi/stage"
socket = "/tmp/csi.sock"
endpoint = "unix://" + socket
)

var ebsDriver *driver.Driver

func TestSanity(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "AWS EBS CSI Driver Sanity Tests")
RunSpecs(t, "Sanity Tests Suite")
}

var _ = Describe("AWS EBS CSI Driver", func() {
const (
mountPath = "/tmp/csi/mount"
stagePath = "/tmp/csi/stage"
socket = "/tmp/csi.sock"
endpoint = "unix://" + socket
)
var _ = BeforeSuite(func() {
ebsDriver = driver.NewDriver(cloud.NewFakeCloudProvider(), driver.NewFakeMounter(), endpoint)
go func() {
Expect(ebsDriver.Run()).NotTo(HaveOccurred())
}()
})

var _ = AfterSuite(func() {
ebsDriver.Stop()
Expect(os.RemoveAll(socket)).NotTo(HaveOccurred())
})

var _ = Describe("AWS EBS CSI Driver", func() {
config := &sanity.Config{
Address: endpoint,
TargetPath: mountPath,
StagingPath: stagePath,
}

var ebsDriver *driver.Driver

BeforeEach(func() {
ebsDriver = driver.NewDriver(cloud.NewFakeCloudProvider(), driver.NewFakeMounter(), endpoint)
go func() {
err := ebsDriver.Run()
Expect(err).To(BeNil())
}()
})

AfterEach(func() {
ebsDriver.Stop()
if err := os.Remove(socket); err != nil && !os.IsNotExist(err) {
Expect(err).To(BeNil())
}
})

Describe("Sanity Test", func() {
sanity.GinkgoTest(config)
})

sanity.GinkgoTest(config)
})