Commit 9e2559e4 authored by Jihun Ha's avatar Jihun Ha Committed by Madan Lanka

Updated ESResult which supports more detail.

 - ES_COMMUNICATION_ERROR
 - ES_ENROLLEE_DISCOVERY_FAILURE
 - ES_SECURE_RESOURCE_DISCOVERY_FAILURE
 - ES_OWNERSHIP_TRANSFER_FAILURE
 - ES_ACL_TRANSFER_FAILURE
 - ES_CERT_TRANSFER_FAILURE

Change-Id: I5f6afd5923d3b6c72c56b2cf726514823ff8d24a
Signed-off-by: default avatarParkhi <h_w.park@samsung.com>
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11947Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 8585ac6a
......@@ -422,8 +422,7 @@ TEST_F(EasysetupEnrolleeTest, CloudServerProperiesProvisionedWithSuccess)
mocks.OnCallFunc(cloudProvisioningStatusCallback).Do(
[& cntForReceivedCallbackWithSuccess](std::shared_ptr< CloudPropProvisioningStatus > status)
{
// Will called twice
if(status->getESResult() == ES_OK || status->getESResult() == ES_FOUND_ENROLLEE)
if(status->getESResult() == ES_OK)
{
cntForReceivedCallbackWithSuccess++;
}
......@@ -447,7 +446,7 @@ TEST_F(EasysetupEnrolleeTest, CloudServerProperiesProvisionedWithSuccess)
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
EXPECT_EQ(cntForReceivedCallbackWithSuccess, 3);
EXPECT_EQ(cntForReceivedCallbackWithSuccess, 2);
ESTerminateEnrollee();
}
......
......@@ -130,37 +130,49 @@ typedef enum
ES_OK = 0,
/**
* Successfully found Enrollee in a given network. This will be given in Cloud provisioning step.
* Enrollee discovery fails in cloud provisioning
*/
ES_FOUND_ENROLLEE = 1,
ES_ENROLLEE_DISCOVERY_FAILURE = 11,
/**
* Not found Enrollee in a give network. This will be given in Cloud provisioning step.
* Valid GET or POST request fails for some reason.
* This failure may happen when it failed to receive any response from Enrollee by a timeout threshold
*/
ES_NOT_FOUND_ENROLLEE = 11,
ES_COMMUNICATION_ERROR,
/**
* Security opertion is not supported because it is built as unsecured mode.
* Security opertion is not supported because Mediator is built as unsecured mode.
*/
ES_SEC_OPERATION_IS_NOT_SUPPORTED = 20,
/**
* A previous request is denied due to its unauthority. It means, Mediator is not unauthroized
* to Enrollee for some reaons.
* Security resource discovery fails due to loss of discovery packet or absence of the resource in a network
*/
ES_UNAUTHORIZED_REQ = 21,
ES_SECURE_RESOURCE_DISCOVERY_FAILURE,
/**
* Security provisioning fails. The reasons would be: a packet loss for unowned/owned device
* discovery request or ownership transfer request, or a denial to ownership transfer by Enrollee
* for some reason.
* Ownership transfer fails because DTLS handshake failure happens
*/
ES_SEC_PROVISION_FAILS = 22,
ES_OWNERSHIP_TRANSFER_FAILURE,
/**
* ACL provisioning fails in cloud provisioning.
* It could be that UUID format of cloud server is wrong.
* Or any response for the provisioning request is not arrived at Mediator
*/
ES_ACL_PROVISIONING_FAILURE,
/**
* Cert. provisioning fails in cloud provisioning.
* It could be that you put a wrong cred ID of which the corresponding certificate does not exist in SVR DB.
* Or any response for the provisioning request is not arrived at Mediator
*/
ES_CERT_PROVISIONING_FAILURE,
/**
* Provisioning fails for some reason.
*/
ES_ERROR = 255,
ES_ERROR = 255
} ESResult;
/**
......
......@@ -148,8 +148,8 @@ print "Files path is %s" % env.get('es_src')
######################################################################
# Generate RichSDK Mediator AAR
################################################ ######################
if target_os in ['android']:
SConscript('android/SConscript')
#if target_os in ['android']:
# SConscript('android/SConscript')
######################################################################
# Build RichSDK Mediator Sample App
......@@ -157,8 +157,8 @@ if target_os in ['android']:
if target_os in ['linux']:
SConscript('../../sampleapp/mediator/linux/richsdk_sample/SConscript')
if target_os in ['android']:
SConscript('../../sampleapp/mediator/android/SConscript')
#if target_os in ['android']:
# SConscript('../../sampleapp/mediator/android/SConscript')
######################################################################
......
......@@ -68,10 +68,11 @@ namespace OIC
OIC_LOG(DEBUG, ES_CLOUD_RES_TAG,"onCloudProvResponse : onCloudProvResponse is failed ");
if (eCode == OCStackResult::OC_STACK_UNAUTHORIZED_REQ)
if(eCode == OCStackResult::OC_STACK_COMM_ERROR)
{
OIC_LOG(DEBUG, ES_CLOUD_RES_TAG, "Mediator is unauthorized from Enrollee.");
result = ESResult::ES_UNAUTHORIZED_REQ;
OIC_LOG_V (DEBUG, ES_CLOUD_RES_TAG,
"can't receive any response from Enrollee by a timeout threshold.");
result = ESResult::ES_COMMUNICATION_ERROR;
}
std::shared_ptr< CloudPropProvisioningStatus > provStatus = std::make_shared<
......
......@@ -46,10 +46,20 @@ namespace OIC
if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED)
{
ESResult result = ESResult::ES_ERROR;
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"onProvisioningResponse : Provisioning is failed ");
"onProvisioningResponse : Provisioning is failed ");
if(eCode == OCStackResult::OC_STACK_COMM_ERROR)
{
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"can't receive any response from Enrollee by a timeout threshold.");
result = ESResult::ES_COMMUNICATION_ERROR;
}
std::shared_ptr< DevicePropProvisioningStatus > provStatus = std::make_shared<
DevicePropProvisioningStatus >(ESResult::ES_ERROR);
DevicePropProvisioningStatus >(result);
m_devicePropProvStatusCb(provStatus);
return;
}
......@@ -75,11 +85,11 @@ namespace OIC
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"onGetStatusResponse : onGetStatusResponse is failed ");
if (eCode == OCStackResult::OC_STACK_UNAUTHORIZED_REQ)
if(eCode == OCStackResult::OC_STACK_COMM_ERROR)
{
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"Mediator is unauthorized from Enrollee.");
result = ESResult::ES_UNAUTHORIZED_REQ;
"can't receive any response from Enrollee by a timeout threshold.");
result = ESResult::ES_COMMUNICATION_ERROR;
}
EnrolleeStatus enrolleeStatus(rep);
......@@ -106,16 +116,16 @@ namespace OIC
if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED)
{
ESResult result = ESResult::ES_ERROR;
ESResult result = ESResult::ES_ERROR;
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"onGetConfigurationResponse : onGetConfigurationResponse is failed ");
if (eCode == OCStackResult::OC_STACK_UNAUTHORIZED_REQ)
if(eCode == OCStackResult::OC_STACK_COMM_ERROR)
{
OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
"Mediator is unauthorized from Enrollee.");
result = ESResult::ES_UNAUTHORIZED_REQ;
"can't receive any response from Enrollee by a timeout threshold.");
result = ESResult::ES_COMMUNICATION_ERROR;
}
EnrolleeConf enrolleeConf(rep);
......
......@@ -111,13 +111,7 @@ namespace OIC
if (hasError)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG,"Error!!! in OwnershipTransfer");
std::string uuid;
convertUUIDToString(result->at(0).deviceId.id, uuid);
std::shared_ptr< SecProvisioningStatus > securityProvisioningStatus =
std::make_shared< SecProvisioningStatus >(uuid, ES_ERROR);
m_securityProvStatusCb(securityProvisioningStatus);
return;
OTMResult = false;
}
else
{
......@@ -125,22 +119,17 @@ namespace OIC
for (unsigned int i = 0; i < result->size(); i++)
{
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device",result->at(i).res);
std::string uuid;
convertUUIDToString(result->at(0).deviceId.id, uuid);
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "UUID : %s",uuid.c_str());
std::shared_ptr< SecProvisioningStatus > securityProvisioningStatus =
std::make_shared< SecProvisioningStatus >(uuid, ES_OK);
m_securityProvStatusCb(securityProvisioningStatus);
return;
}
delete result;
OTMResult = true;
}
m_cond.notify_all();
}
void EnrolleeSecurity::provisionOwnership()
ESResult EnrolleeSecurity::provisionOwnership()
{
ESResult res = ESResult::ES_ERROR;
OC::DeviceList_t pUnownedDevList, pOwnedDevList;
pOwnedDevList.clear();
......@@ -153,8 +142,8 @@ namespace OIC
if (result != OC_STACK_OK)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Owned Discovery failed.");
//Throw exception
throw ESPlatformException(result);
res = ESResult:: ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
return res;
}
else if (pOwnedDevList.size())
{
......@@ -165,10 +154,8 @@ namespace OIC
if (ownedDevice)
{
std::shared_ptr< SecProvisioningStatus > securityProvisioningStatus =
std::make_shared< SecProvisioningStatus >(ownedDevice->getDeviceID(), ES_OK);
m_securityProvStatusCb(securityProvisioningStatus);
return;
res = ESResult::ES_OK;
return res;
}
}
......@@ -176,8 +163,8 @@ namespace OIC
if (result != OC_STACK_OK)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "UnOwned Discovery failed.");
//Throw exception
throw ESPlatformException(result);
res = ESResult:: ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
return res;
}
else if (pUnownedDevList.size())
{
......@@ -196,29 +183,58 @@ namespace OIC
&EnrolleeSecurity::removeDeviceWithUuidCB,
this, std::placeholders::_1, std::placeholders::_2);
OCSecure::removeDeviceWithUuid(DISCOVERY_TIMEOUT,
m_ocResource->sid(),
removeDeviceWithUuidCB);
result = OCSecure::removeDeviceWithUuid(DISCOVERY_TIMEOUT,
m_ocResource->sid(),
removeDeviceWithUuidCB);
if(result != OC_STACK_OK)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "removeDeviceWithUuid failed.");
res = ESResult:: ES_OWNERSHIP_TRANSFER_FAILURE;
return res;
}
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait_for(lck, std::chrono::seconds(ES_SEC_DISCOVERY_TIMEOUT));
if(!removeDeviceResult)
{
res = ESResult:: ES_OWNERSHIP_TRANSFER_FAILURE;
return res;
}
}
else
res = performOwnershipTransfer();
if(res != ESResult::ES_OK)
{
performOwnershipTransfer();
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Ownership-Transfer failed.");
res = ESResult:: ES_OWNERSHIP_TRANSFER_FAILURE;
return res;
}
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait_for(lck, std::chrono::seconds(ES_SEC_DISCOVERY_TIMEOUT));
if(!OTMResult)
{
res = ESResult::ES_OWNERSHIP_TRANSFER_FAILURE;
}
}
else
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No matched unowned devices found.");
throw ESException("No matched unowned devices found.");
res = ESResult:: ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
}
}
else
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No unowned devices found.");
throw ESException("No unowned devices found.");
res = ESResult:: ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
}
return res;
}
void EnrolleeSecurity::performOwnershipTransfer()
ESResult EnrolleeSecurity::performOwnershipTransfer()
{
OCStackResult result = OC_STACK_ERROR;
......@@ -241,8 +257,9 @@ namespace OIC
if (result != OC_STACK_OK)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "doOwnershipTransfer is failed");
throw ESPlatformException(result);
return ESResult::ES_ERROR;
}
return ESResult::ES_OK;
}
void EnrolleeSecurity::removeDeviceWithUuidCB(OC::PMResultList_t *result, int hasError)
......@@ -250,7 +267,7 @@ namespace OIC
if (hasError)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Error in removeDeviceWithUuid operation!");
throw ESException("removeDeviceWithUuid Error");
removeDeviceResult = false;
}
else
......@@ -265,8 +282,9 @@ namespace OIC
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG,
"Result is = %d for device %s", result->at(i).res, uuid.c_str());
}
performOwnershipTransfer();
removeDeviceResult = true;
}
m_cond.notify_all();
}
bool EnrolleeSecurity::isOwnedDeviceRegisteredInSVRDB()
......@@ -308,9 +326,11 @@ namespace OIC
};
#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
void EnrolleeSecurity::provisionSecurityForCloudServer(
ESResult EnrolleeSecurity::provisionSecurityForCloudServer(
std::string cloudUuid, int credId)
{
ESResult res = ESResult::ES_ERROR;
// Need to discover Owned device in a given network, again
OC::DeviceList_t pOwnedDevList;
std::shared_ptr< OC::OCSecureResource > ownedDevice = NULL;
......@@ -324,8 +344,8 @@ namespace OIC
if (result != OC_STACK_OK)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Owned Discovery failed.");
//Throw exception
throw ESPlatformException(result);
res = ESResult::ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
return res;
}
else if (pOwnedDevList.size())
{
......@@ -336,13 +356,15 @@ namespace OIC
if (!ownedDevice)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Not found matched owned device.");
throw ESException("Not found matched owned device.");
res = ESResult::ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
return res;
}
}
else
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Not found owned devices.");
throw ESException("Not found owned devices.");
res = ESResult::ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
return res;
}
if(cloudUuid.empty())
......@@ -350,10 +372,14 @@ namespace OIC
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG,
"ACL provisioning is skipped due to empty UUID of cloud server");
}
else if(performACLProvisioningForCloudServer(ownedDevice, cloudUuid) != ESResult::ES_OK)
else
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performACLProvisioningForCloudServer");
throw ESException("error performACLProvisioningForCloudServer");
res = performACLProvisioningForCloudServer(ownedDevice, cloudUuid);
if(res != ESResult::ES_OK)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performACLProvisioningForCloudServer");
return res;
}
}
if(credId < 1)
......@@ -361,17 +387,23 @@ namespace OIC
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG,
"Cert. provisioning is skipped due to wrong cred ID (<1)");
}
else if(performCertProvisioningForCloudServer(ownedDevice, credId) != ESResult::ES_OK)
else
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performCertProvisioningForCloudServer");
throw ESException("error performCertProvisioningForCloudServer");
res = performCertProvisioningForCloudServer(ownedDevice, credId);
if(res != ESResult::ES_OK)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performCertProvisioningForCloudServer");
return res;
}
}
return res;
}
ESResult EnrolleeSecurity::performCertProvisioningForCloudServer(
std::shared_ptr< OC::OCSecureResource > ownedDevice, int credId)
{
ESResult res = ESResult::ES_ERROR;
ESResult res = ESResult::ES_CERT_PROVISIONING_FAILURE;
if(!ownedDevice)
{
......@@ -404,18 +436,13 @@ namespace OIC
ESResult EnrolleeSecurity::performACLProvisioningForCloudServer(
std::shared_ptr< OC::OCSecureResource > ownedDevice, std::string& cloudUuid)
{
ESResult res = ESResult::ES_ERROR;
ESResult res = ESResult::ES_ACL_PROVISIONING_FAILURE;
if(!ownedDevice)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Invalid param");
return res;
}
if(cloudUuid.empty())
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Invalid param");
return res;
}
OicUuid_t uuid;
ConvertStrToUuid(cloudUuid.c_str(), &uuid);
......
......@@ -56,7 +56,7 @@ namespace OIC
const SecurityProvStatusCb securityProvStatusCb,
const SecurityPinCb securityPinCb,
const SecProvisioningDbPathCb secProvisioningDbPathCb);
void provisionOwnership();
ESResult provisionOwnership();
std::string getUUID() const;
private:
......@@ -68,13 +68,15 @@ namespace OIC
std::mutex m_mtx;
std::condition_variable m_cond;
std::atomic<bool> aclResult;
std::atomic<bool> certResult;
std::atomic<bool> OTMResult;
std::atomic<bool> removeDeviceResult;
std::atomic<bool> aclResult;
std::atomic<bool> certResult;
std::shared_ptr< OC::OCSecureResource > m_securedResource;
std::shared_ptr< OC::OCSecureResource > findEnrolleeSecurityResource(
OC::DeviceList_t &list);
void performOwnershipTransfer();
ESResult performOwnershipTransfer();
bool isOwnedDeviceRegisteredInSVRDB();
void removeDeviceWithUuidCB(OC::PMResultList_t *result, int hasError);
void ownershipTransferCb(OC::PMResultList_t *result, int hasError);
......@@ -83,7 +85,7 @@ namespace OIC
#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
public:
void provisionSecurityForCloudServer(
ESResult provisionSecurityForCloudServer(
std::string cloudUuid, int credId);
private:
ESResult performCertProvisioningForCloudServer(
......
......@@ -224,7 +224,7 @@ namespace OIC
void RemoteEnrollee::provisionSecurity(const SecurityProvStatusCb callback)
{
#ifdef __WITH_DTLS__
std::cout << __func__ << std::endl;
ESResult res = ESResult::ES_ERROR;
if(!callback)
{
throw ESInvalidParameterException("Callback is empty");
......@@ -241,22 +241,11 @@ namespace OIC
m_enrolleeSecurity->registerCallbackHandler(securityProvStatusCb, m_securityPinCb,
m_secProvisioningDbPathCb);
try
{
m_enrolleeSecurity->provisionOwnership();
}
catch (const std::exception& e)
{
OIC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_TAG,
"Exception for performOwnershipTransfer : %s", e.what());
OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Fail performOwnershipTransfer");
std::shared_ptr< SecProvisioningStatus > securityProvisioningStatus =
std::make_shared< SecProvisioningStatus >
(m_enrolleeSecurity->getUUID(), ES_ERROR);
m_securityProvStatusCb(securityProvisioningStatus);
return ;
}
res = m_enrolleeSecurity->provisionOwnership();
std::shared_ptr< SecProvisioningStatus > securityProvisioningStatus =
std::make_shared< SecProvisioningStatus >(m_enrolleeSecurity->getUUID(), res);
m_securityProvStatusCb(securityProvisioningStatus);
#else
OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Mediator is unsecured.");
if(!callback)
......@@ -359,11 +348,6 @@ namespace OIC
if(m_ocResource != nullptr)
{
m_cloudResource = std::make_shared<CloudResource>(m_ocResource);
std::shared_ptr< CloudPropProvisioningStatus > provStatus = std::make_shared<
CloudPropProvisioningStatus >(ESResult::ES_FOUND_ENROLLEE);
m_cloudPropProvStatusCb(provStatus);
}
else
{
......@@ -402,35 +386,29 @@ namespace OIC
"Exception caught in provisionCloudProperties = %s", e.what());
std::shared_ptr< CloudPropProvisioningStatus > provStatus = std::make_shared<
CloudPropProvisioningStatus >(ESResult::ES_NOT_FOUND_ENROLLEE);
CloudPropProvisioningStatus >(ESResult::ES_ENROLLEE_DISCOVERY_FAILURE);
m_cloudPropProvStatusCb(provStatus);
return;
}
#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
try
ESResult res = ESResult::ES_ERROR;
if(!(cloudProp.getCloudID().empty() && cloudProp.getCredID() <= 0))
{
if(!(cloudProp.getCloudID().empty() && cloudProp.getCredID() <= 0))
{
m_enrolleeSecurity = std::make_shared <EnrolleeSecurity> (m_ocResource, "");
m_enrolleeSecurity = std::make_shared <EnrolleeSecurity> (m_ocResource, "");
m_enrolleeSecurity->provisionSecurityForCloudServer(cloudProp.getCloudID(),
cloudProp.getCredID());
}
else
{
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "ACL and Cert. provisioning are skipped.");
}
res = m_enrolleeSecurity->provisionSecurityForCloudServer(cloudProp.getCloudID(),
cloudProp.getCredID());
}
catch (const std::exception& e)
else
{
OIC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_TAG,
"Exception caught in provisionCloudProperties = %s", e.what());
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "ACL and Cert. provisioning are skipped.");
}
if(res != ESResult::ES_OK)
{
m_cloudResource = nullptr;
std::shared_ptr< CloudPropProvisioningStatus > provStatus = std::make_shared<
CloudPropProvisioningStatus >(ESResult::ES_ERROR);
CloudPropProvisioningStatus >(res);
m_cloudPropProvStatusCb(provStatus);
return;
}
......
......@@ -462,8 +462,7 @@ TEST_F(ProvisionCloudPropertiesTest, ProvisionCloudPropertiesSucceed)
mocks.OnCallFunc(cloudPropProvStatusCb).Do(
[& cntForReceivedCallbackWithSuccess](std::shared_ptr< CloudPropProvisioningStatus > status)
{
// Will called twice
if(status->getESResult() == ES_OK || status->getESResult() == ES_FOUND_ENROLLEE)
if(status->getESResult() == ES_OK)
{
cntForReceivedCallbackWithSuccess++;
}
......@@ -474,7 +473,7 @@ TEST_F(ProvisionCloudPropertiesTest, ProvisionCloudPropertiesSucceed)
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
EXPECT_EQ(cntForReceivedCallbackWithSuccess, 2);
EXPECT_EQ(cntForReceivedCallbackWithSuccess, 1);
ESTerminateEnrollee();
}
......@@ -222,12 +222,15 @@ void cloudProvisioningStatusCallback(std::shared_ptr< CloudPropProvisioningStatu
case ES_OK:
cout << "Cloud Provisioning is success." << endl;
break;
case ES_FOUND_ENROLLEE:
cout << "Enrollee is found in a given network." << endl;