@@ -487,6 +487,25 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
487
487
Expect (serverError .Code ()).To (Equal (codes .InvalidArgument ))
488
488
})
489
489
490
+ It ("should fail when the volume is missing" , func () {
491
+ _ , err := c .NodeStageVolume (
492
+ context .Background (),
493
+ & csi.NodeStageVolumeRequest {
494
+ VolumeId : sc .Config .IDGen .GenerateUniqueValidVolumeID (),
495
+ VolumeCapability : TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ),
496
+ PublishContext : map [string ]string {
497
+ "device" : device ,
498
+ },
499
+ StagingTargetPath : sc .StagingPath ,
500
+ })
501
+ Expect (err ).To (HaveOccurred ())
502
+
503
+ serverError , ok := status .FromError (err )
504
+ Expect (ok ).To (BeTrue ())
505
+ Expect (serverError .Code ()).To (Equal (codes .NotFound ))
506
+
507
+ })
508
+
490
509
It ("should fail when no volume capability is provided" , func () {
491
510
492
511
// Create Volume First
@@ -582,6 +601,20 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
582
601
Expect (ok ).To (BeTrue ())
583
602
Expect (serverError .Code ()).To (Equal (codes .InvalidArgument ))
584
603
})
604
+
605
+ It ("should fail when the volume is missing" , func () {
606
+ _ , err := c .NodeUnstageVolume (
607
+ context .Background (),
608
+ & csi.NodeUnstageVolumeRequest {
609
+ VolumeId : sc .Config .IDGen .GenerateUniqueValidVolumeID (),
610
+ StagingTargetPath : sc .StagingPath ,
611
+ })
612
+ Expect (err ).To (HaveOccurred ())
613
+
614
+ serverError , ok := status .FromError (err )
615
+ Expect (ok ).To (BeTrue ())
616
+ Expect (serverError .Code ()).To (Equal (codes .NotFound ))
617
+ })
585
618
})
586
619
587
620
Describe ("NodeGetVolumeStats" , func () {
0 commit comments