Fix uninstall API policy 32/141132/1 accepted/tizen/4.0/unified/20170816.012820 accepted/tizen/4.0/unified/20170829.020430 accepted/tizen/unified/20170731.153835 submit/tizen/20170731.054223 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
authorsangwan.kwon <sangwan.kwon@samsung.com>
Fri, 28 Jul 2017 07:48:54 +0000 (16:48 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Fri, 28 Jul 2017 07:48:54 +0000 (16:48 +0900)
[AS-IS]
- If trust-anchor is never installed and uninstall API is called,
  return FAILED-status error code.

[TO-BE]
- If trust-anchor is never installed and uninstall API is called,
  notify to log as warning and process continue.

Change-Id: I2aff6aca3622dba4e7edaa811c5a735c3ffb67c4
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
src/logic.cpp
tests/test-capi-installer.cpp
tests/test-installer.cpp

index 741a6d52f75f721b507c433fec9240a37b16eddc..bada39700aa4206fac936a0ca0532d02c376c221 100644 (file)
@@ -69,7 +69,7 @@ void Logic::deinit(bool isRollback) const
        if (customBaseDir.exists())
                customBaseDir.remove(true);
        else if (!isRollback)
-               throw std::invalid_argument("tanchor is never installed before.");
+               WARN(SINK, "tanchor is never installed before.");
 
        DEBUG(SINK, "Success to deinit[" << this->m_customBasePath << "]");
 }
index a29f504a1554d04855d9d3dcfe41540d61128aee..2c583c8357d4405f207b3ed99ade47742e4cb19b 100644 (file)
@@ -59,8 +59,8 @@ TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_POSITIVE)
        TEST_EXPECT(true, ret == TRUST_ANCHOR_ERROR_NONE);
 }
 
-TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_NEGATIVE)
+TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_POSITIVE_WARNING)
 {
        int ret = trust_anchor_uninstall(DUMMY_PKG_ID, DUMMY_UID);
-       TEST_EXPECT(false, ret == TRUST_ANCHOR_ERROR_NONE);
+       TEST_EXPECT(true, ret == TRUST_ANCHOR_ERROR_NONE);
 }
index 2bffbf4b0ecfe73ed5cbbe5c174c1db67c2de20b..722a3cb1a0948da7ee5558a3eceb1854edbd21d9 100644 (file)
@@ -71,11 +71,11 @@ TESTCASE(TRUST_ANCHOR_UNINSTALL_POSITIVE)
        TEST_EXPECT(true, ret == TRUST_ANCHOR_ERROR_NONE);
 }
 
-TESTCASE(TRUST_ANCHOR_UNINSTALL_NEGATIVE)
+TESTCASE(TRUST_ANCHOR_UNINSTALL_POSITIVE_WARNING)
 {
        tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_UID);
        int ret = ta.uninstall();
-       TEST_EXPECT(false, ret == TRUST_ANCHOR_ERROR_NONE);
+       TEST_EXPECT(true, ret == TRUST_ANCHOR_ERROR_NONE);
 }
 
 TESTCASE(TRUST_ANCHOR_UNINSTALL_NO_ORIGINAL_CERTS)