[VOL-2673]:added check to verify deletion of onu devices on deleting same.

Change-Id: If01e3ccca6bfd605cee5f5a46a3cddc2b4e6a483
diff --git a/rw_core/core/common_test.go b/rw_core/core/common_test.go
index 1128cde..346198d 100644
--- a/rw_core/core/common_test.go
+++ b/rw_core/core/common_test.go
@@ -159,7 +159,7 @@
 	go func() {
 		for {
 			device, _ := nbi.GetDevice(getContext(), &voltha.ID{Id: deviceID})
-			if device != nil && verificationFunction(device) {
+			if verificationFunction(device) {
 				ch <- 1
 				break
 			}
diff --git a/rw_core/core/grpc_nbi_api_handler_test.go b/rw_core/core/grpc_nbi_api_handler_test.go
index b0f0029..1abc565 100755
--- a/rw_core/core/grpc_nbi_api_handler_test.go
+++ b/rw_core/core/grpc_nbi_api_handler_test.go
@@ -551,11 +551,19 @@
 		err = waitUntilDeviceReadiness(onu.Id, nb.maxTimeout, vdFunction, nbi)
 		assert.Nil(t, err)
 	}
+	// Wait for each onu device to get deleted
+	var vdFunc isDeviceConditionSatisfied = func(device *voltha.Device) bool {
+		return device == nil
+	}
+
 	// Delete the onuDevice
 	for _, onu := range onuDevices.Items {
 		_, err = nbi.DeleteDevice(getContext(), &voltha.ID{Id: onu.Id})
 		assert.Nil(t, err)
+		err = waitUntilDeviceReadiness(onu.Id, nb.maxTimeout, vdFunc, nbi)
+		assert.Nil(t, err)
 	}
+
 	// Disable the oltDevice
 	_, err = nbi.DisableDevice(getContext(), &voltha.ID{Id: oltDevice.Id})
 	assert.Nil(t, err)