diff --git a/tests/logger-config-global-fixture.cpp b/tests/global-configuration-fixture.cpp
similarity index 86%
rename from tests/logger-config-global-fixture.cpp
rename to tests/global-configuration-fixture.cpp
index 659edf9..cec1aa9 100644
--- a/tests/logger-config-global-fixture.cpp
+++ b/tests/global-configuration-fixture.cpp
@@ -48,9 +48,13 @@
     dir /= "test-home";
     setenv("HOME", dir.generic_string().c_str(), 1);
 
-    setenv("NDN_CLIENT_PIB", "pib-sqlite3", 1);
-    setenv("NDN_CLIENT_TPM", "tpm-file", 1);
-    boost::filesystem::create_directories(dir);
+    if (exists(dir)) {
+      remove_all(dir);
+    }
+
+    setenv("NDN_CLIENT_PIB", ("pib-sqlite3:" + dir.string()).c_str(), 1);
+    setenv("NDN_CLIENT_TPM", ("tpm-file:" + dir.string()).c_str(), 1);
+    create_directories(dir);
   }
 
   ~GlobalConfigurationFixture()
@@ -59,10 +63,10 @@
       setenv("HOME", m_home.c_str(), 1);
     }
     if (!m_pib.empty()) {
-      setenv("NDN_CLIENT_PIB", m_home.c_str(), 1);
+      setenv("NDN_CLIENT_PIB", m_pib.c_str(), 1);
     }
     if (!m_tpm.empty()) {
-      setenv("NDN_CLIENT_TPM", m_home.c_str(), 1);
+      setenv("NDN_CLIENT_TPM", m_tpm.c_str(), 1);
     }
   }
 
diff --git a/tests/unit-tests/action-log.t.cpp b/tests/unit-tests/action-log.t.cpp
index 2281026..8d874bc 100644
--- a/tests/unit-tests/action-log.t.cpp
+++ b/tests/unit-tests/action-log.t.cpp
@@ -18,78 +18,87 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include <boost/lexical_cast.hpp>
-#include <boost/test/unit_test.hpp>
-
 #include "action-log.hpp"
-#include "logging.hpp"
 
-#include <boost/filesystem.hpp>
-#include <boost/make_shared.hpp>
-#include <iostream>
-#include <unistd.h>
+#include "test-common.hpp"
+#include "dummy-forwarder.hpp"
 
-using namespace std;
-using namespace boost;
-using namespace Ndnx;
+namespace ndn {
+namespace chronoshare {
+namespace tests {
+
 namespace fs = boost::filesystem;
 
-BOOST_AUTO_TEST_SUITE(TestActionLog)
-
-BOOST_AUTO_TEST_CASE(ActionLogTest)
+class TestActionLogFixture : public IdentityManagementTimeFixture
 {
-  Name localName("/alex");
+public:
+  TestActionLogFixture()
+    : forwarder(m_io, m_keyChain)
+    , localName("/lijing")
+    , tmpdir(fs::unique_path(UNIT_TEST_CONFIG_PATH))
+  {
+    if (exists(tmpdir)) {
+      remove_all(tmpdir);
+    }
 
-  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
-  SyncLogPtr syncLog = make_shared<SyncLog>(tmpdir, localName);
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper>();
+    syncLog = make_shared<SyncLog>(tmpdir, localName);
+  }
 
-  ActionLogPtr actionLog =
-    make_shared<ActionLog>(ccnx, tmpdir, syncLog, "top-secret", "test-chronoshare",
-                           ActionLog::OnFileAddedOrChangedCallback(),
-                           ActionLog::OnFileRemovedCallback());
+public:
+  DummyForwarder forwarder;
+  Name localName;
+  fs::path tmpdir;
+  shared_ptr<SyncLog> syncLog;
+};
 
-  // const std::string &filename,
-  //                    const Hash &hash,
-  //                    time_t wtime,
-  //                    int mode,
-  //                    int seg_num
+BOOST_FIXTURE_TEST_SUITE(TestActionLog, TestActionLogFixture)
+
+BOOST_AUTO_TEST_CASE(UpdateAction)
+{
+  auto actionLog = std::make_shared<ActionLog>(forwarder.addFace(), tmpdir, syncLog,
+                                               "top-secret", "test-chronoshare",
+                                               ActionLog::OnFileAddedOrChangedCallback(),
+                                               ActionLog::OnFileRemovedCallback());
+
   BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 0);
 
   BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
   BOOST_CHECK_EQUAL(actionLog->LogSize(), 0);
 
   actionLog->AddLocalActionUpdate("file.txt",
-                                  *Hash::FromString(
-                                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
-                                  time(NULL), 0755, 10);
+                                  *fromHex("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
+                                  std::time(nullptr), 0755, 10);
 
   BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 1);
   BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
   BOOST_CHECK_EQUAL(actionLog->LogSize(), 1);
 
-  HashPtr hash = syncLog->RememberStateInStateLog();
+  ndn::ConstBufferPtr hash = syncLog->RememberStateInStateLog();
   BOOST_CHECK_EQUAL(syncLog->LogSize(), 1);
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "91A849EEDE75ACD56AE1BCB99E92D8FB28757683BC387DBB0E59C3108FCF4F18");
 
-  PcoPtr pco = actionLog->LookupActionPco(localName, 0);
-  BOOST_CHECK_EQUAL((bool)pco, false);
+  ndn::shared_ptr<ndn::Data> data = actionLog->LookupActionData(localName, 0);
 
-  pco = actionLog->LookupActionPco(localName, 1);
-  BOOST_CHECK_EQUAL((bool)pco, true);
+  BOOST_CHECK_EQUAL(bool(data), false);
 
-  BOOST_CHECK_EQUAL(pco->name(), "/alex/test-chronoshare/action/top-secret/%00%01");
+  data = actionLog->LookupActionData(localName, 1);
 
-  ActionItemPtr action = actionLog->LookupAction(Name("/alex/test-chronoshare/action/top-secret")(0));
+  BOOST_CHECK_EQUAL(bool(data), true);
+
+  BOOST_CHECK_EQUAL(data->getName(), "/lijing/test-chronoshare/action/top-secret/%01");
+
+  ActionItemPtr action =
+    actionLog->LookupAction(Name("/lijing/test-chronoshare/action/top-secret").appendNumber(0));
   BOOST_CHECK_EQUAL((bool)action, false);
 
-  action = actionLog->LookupAction(Name("/alex/test-chronoshare/action/top-secret")(1));
+  action =
+    actionLog->LookupAction(Name("/lijing/test-chronoshare/action/top-secret").appendNumber(1));
   BOOST_CHECK_EQUAL((bool)action, true);
 
   if (action) {
     BOOST_CHECK_EQUAL(action->version(), 0);
-    BOOST_CHECK_EQUAL(action->action(), 0);
+    BOOST_CHECK_EQUAL(action->action(), ActionItem::UPDATE);
 
     BOOST_CHECK_EQUAL(action->filename(), "file.txt");
     BOOST_CHECK_EQUAL(action->seg_num(), 10);
@@ -101,14 +110,13 @@
   }
 
   actionLog->AddLocalActionUpdate("file.txt",
-                                  *Hash::FromString(
-                                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
-                                  time(NULL), 0755, 10);
+                                  *fromHex("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
+                                  std::time(nullptr), 0755, 10);
   BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 2);
   BOOST_CHECK_EQUAL(syncLog->LogSize(), 1);
   BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
 
-  action = actionLog->LookupAction(Name("/alex"), 2);
+  action = actionLog->LookupAction(Name("/lijing"), 2);
   BOOST_CHECK_EQUAL((bool)action, true);
 
   if (action) {
@@ -119,30 +127,120 @@
     BOOST_CHECK_EQUAL(action->version(), 1);
   }
 
-  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(pco), true);
+  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(data), true);
   BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
 
   // create a real remote action
-  ActionItem item;
-  item.set_action(ActionItem::UPDATE);
-  item.set_filename("file.txt");
-  item.set_version(2);
-  item.set_timestamp(time(NULL));
+  ActionItemPtr item = make_shared<ActionItem>();
+  item->set_action(ActionItem::UPDATE);
+  item->set_filename("file.txt");
+  item->set_version(2);
+  item->set_timestamp(std::time(nullptr));
 
-  BytesPtr item_msg = serializeMsg(item);
-  Name actionName = Name("/")(Name("/zhenkai/test"))("test-chronoshare")("action")("top-secret")(1);
-  Bytes actionData = ccnx->createContentObject(actionName, head(*item_msg), item_msg->size());
+  std::string item_msg;
+  item->SerializeToString(&item_msg);
 
-  pco = make_shared<ParsedContentObject>(actionData);
-  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(pco), true);
+  Name actionName = Name("/zhenkai/test/test-chronoshare/action/top-secret").appendNumber(1);
+
+  ndn::shared_ptr<Data> actionData = ndn::make_shared<Data>();
+  actionData->setName(actionName);
+  actionData->setContent(reinterpret_cast<const uint8_t*>(item_msg.c_str()), item_msg.size());
+  ndn::KeyChain m_keyChain;
+  m_keyChain.sign(*actionData);
+
+  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(actionData), true);
   BOOST_CHECK_EQUAL(actionLog->LogSize(), 3);
+}
 
-  remove_all(tmpdir);
+BOOST_AUTO_TEST_CASE(DeleteAction)
+{
+  bool hasDeleteCallbackCalled = false;
+  auto actionLog = std::make_shared<ActionLog>(forwarder.addFace(), tmpdir, syncLog,
+                                               "top-secret", "test-chronoshare",
+                                               ActionLog::OnFileAddedOrChangedCallback(),
+                                               bind([&] { hasDeleteCallbackCalled = true; }));
+
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 0);
+
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 0);
+
+  actionLog->AddLocalActionUpdate("file.txt",
+                                  *fromHex("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
+                                  std::time(nullptr), 0755, 10);
+
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 1);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 1);
+
+  syncLog->RememberStateInStateLog();
+
+  actionLog->AddLocalActionDelete("file.txt");
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 2);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 1);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
+  BOOST_CHECK(hasDeleteCallbackCalled);
+
+  ndn::ConstBufferPtr hash = syncLog->RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 2);
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
+
+  ndn::shared_ptr<ndn::Data> data = actionLog->LookupActionData(localName, 2);
+  BOOST_CHECK(data != nullptr);
+
+  BOOST_CHECK_EQUAL(data->getName(), "/lijing/test-chronoshare/action/top-secret/%02");
+
+  ActionItemPtr action = actionLog->LookupAction(Name("/lijing/test-chronoshare/action/top-secret").appendNumber(2));
+  BOOST_CHECK(action != nullptr);
+
+  if (action) {
+    BOOST_CHECK_EQUAL(action->version(), 1);
+    BOOST_CHECK_EQUAL(action->action(), ActionItem::DELETE);
+
+    BOOST_CHECK_EQUAL(action->filename(), "file.txt");
+
+    BOOST_CHECK_EQUAL(Name(Block(action->parent_device_name().data(), action->parent_device_name().size())),
+                      Name("/lijing"));
+    BOOST_CHECK_EQUAL(action->parent_seq_no(), 1);
+  }
+
+  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(data), true);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
+
+  // create a real remote action
+  ActionItemPtr item = make_shared<ActionItem>();
+  item->set_action(ActionItem::DELETE);
+  item->set_filename("file.txt");
+  item->set_version(2);
+  item->set_timestamp(std::time(0));
+
+  std::string filename = "file.txt";
+  BufferPtr parent_device_name = std::make_shared<Buffer>(filename.c_str(), filename.size());
+  item->set_parent_device_name(parent_device_name->buf(), parent_device_name->size());
+  item->set_parent_seq_no(0);
+
+  std::string item_msg;
+  item->SerializeToString(&item_msg);
+
+  Name actionName = Name("/yukai/test/test-chronoshare/action/top-secret").appendNumber(1);
+
+  ndn::shared_ptr<Data> actionData = ndn::make_shared<Data>();
+  actionData->setName(actionName);
+  actionData->setContent(reinterpret_cast<const uint8_t*>(item_msg.c_str()), item_msg.size());
+  ndn::KeyChain m_keyChain;
+  m_keyChain.sign(*actionData);
+
+  ActionItemPtr actionItem = actionLog->AddRemoteAction(actionData);
+  BOOST_CHECK_EQUAL((bool)actionItem, true);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 3);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 2);
+
+  BOOST_CHECK_EQUAL(action->action(), ActionItem::DELETE);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
-// catch (boost::exception &err)
-//   {
-//     cout << *boost::get_error_info<errmsg_info_str> (err) << endl;
-//   }
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/wscript b/tests/wscript
index 0b08cc0..ab3e5fe 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -24,9 +24,10 @@
             source=bld.path.ant_glob(['*.cpp',
                                       'unit-tests/dummy-forwarder.cpp',
                                       'unit-tests/sync-*.t.cpp',
+                                      'unit-tests/action-log.t.cpp',
                                       ],
                                      excl=['main.cpp']),
-            use='unit-tests-main core-objects chronoshare',
+            use='chronoshare core-objects unit-tests-main',
             install_path=None,
             defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode),
             includes='.. ../src .',
diff --git a/wscript b/wscript
index 98ad56d..fe8c036 100644
--- a/wscript
+++ b/wscript
@@ -108,7 +108,7 @@
                                   'src/file-state.cpp',
                                   'src/action-log.cpp',
                                   ]),
-        use='core-objects adhoc BOOST NDN_CXX TINYXML SQLITE3',
+        use='core-objects adhoc NDN_CXX BOOST TINYXML SQLITE3',
         includes="src",
         export_includes="src",
         )
