Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Test backfill
Browse files Browse the repository at this point in the history
- return an error if unable to 'wait' on the invoked umount process

[#171189875](https://www.pivotaltracker.com/story/show/171189875)

Authored-by: Dennis Leon <[email protected]>
  • Loading branch information
DennisDenuto committed Feb 12, 2020
1 parent 30d1798 commit afaacbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nodeserver/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (n noOpNodeServer) NodeUnpublishVolume(c context.Context, r *csi.NodeUnpubl

err = cmdshim.Wait()
if err != nil {
println(err.Error())
return nil, status.Error(codes.Internal, err.Error())
}
log.Printf("finished umount")

Expand Down
12 changes: 12 additions & 0 deletions nodeserver/node_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,17 @@ var _ = Describe("NodeServer", func() {
Expect(err.Error()).To(Equal("rpc error: code = Internal desc = start-failed"))
})
})

Context("when the command fails to wait", func() {

BeforeEach(func() {
fakeCmd.WaitReturns(errors.New("wait-failed"))
})

It("should return an error", func() {
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("rpc error: code = Internal desc = wait-failed"))
})
})
})
})

0 comments on commit afaacbf

Please sign in to comment.