diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp
index 14fce9a..99ef78f 100644
--- a/tests/test-conf-file-processor.cpp
+++ b/tests/test-conf-file-processor.cpp
@@ -44,6 +44,7 @@
   "  lsa-refresh-time 1800\n"
   "  lsa-interest-lifetime 3\n"
   "  router-dead-interval 86400\n"
+  "  sync-protocol psync\n"
   "  sync-interest-lifetime 10000\n"
   "  seq-dir /tmp\n"
   "}\n\n";
@@ -175,6 +176,7 @@
   BOOST_CHECK_EQUAL(conf.getChronosyncPrefix(), ndn::Name("/localhop/ndn/nlsr/sync").appendVersion(ConfParameter::SYNC_VERSION));
   BOOST_CHECK_EQUAL(conf.getLsaPrefix(), "/localhop/ndn/nlsr/LSA");
   BOOST_CHECK_EQUAL(conf.getLsaRefreshTime(), 1800);
+  BOOST_CHECK_EQUAL(conf.getSyncProtocol(), SYNC_PROTOCOL_PSYNC);
   BOOST_CHECK_EQUAL(conf.getLsaInterestLifetime(), ndn::time::seconds(3));
   BOOST_CHECK_EQUAL(conf.getRouterDeadInterval(), 86400);
   BOOST_CHECK_EQUAL(conf.getSyncInterestLifetime(), ndn::time::milliseconds(10000));
diff --git a/tests/test-conf-parameter.cpp b/tests/test-conf-parameter.cpp
index 55a65b1..0fdf631 100644
--- a/tests/test-conf-parameter.cpp
+++ b/tests/test-conf-parameter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017,  The University of Memphis,
+ * Copyright (c) 2014-2018,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -53,6 +53,8 @@
 
   cp1.setLsaInterestLifetime(ndn::time::seconds(1));
 
+  cp1.setSyncProtocol(SYNC_PROTOCOL_PSYNC);
+
   cp1.setRouterDeadInterval(10);
 
   cp1.setMaxFacesPerPrefix(50);
@@ -85,6 +87,8 @@
 
   BOOST_CHECK_EQUAL(cp1.getLsaInterestLifetime(), ndn::time::seconds(1));
 
+  BOOST_CHECK_EQUAL(cp1.getSyncProtocol(), SYNC_PROTOCOL_PSYNC);
+
   BOOST_CHECK_EQUAL(cp1.getRouterDeadInterval(), 10);
 
   BOOST_CHECK_EQUAL(cp1.getMaxFacesPerPrefix(), 50);
diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp
index ab9732d..021743c 100644
--- a/tests/test-sync-logic-handler.cpp
+++ b/tests/test-sync-logic-handler.cpp
@@ -60,18 +60,31 @@
     addIdentity(conf.getRouterPrefix());
   }
 
+  template <int32_t N>
+  void
+  setSyncProtocol()
+  {
+    nlsr.getConfParameter().setSyncProtocol(N);
+    conf.setSyncProtocol(N);
+  }
+
+  template <int32_t N>
   void
   receiveUpdate(std::string prefix, uint64_t seqNo, SyncLogicHandler& p_sync)
   {
-    chronosync::MissingDataInfo info = {ndn::Name(prefix).appendNumber(1), 0, seqNo};
-
-    std::vector<chronosync::MissingDataInfo> updates;
-    updates.push_back(info);
-
     this->advanceClocks(ndn::time::milliseconds(1), 10);
     face.sentInterests.clear();
 
-    p_sync.onChronoSyncUpdate(updates);
+    if (N == SYNC_PROTOCOL_CHRONOSYNC) {
+      std::vector<chronosync::MissingDataInfo> updates;
+      updates.push_back({ndn::Name(prefix).appendNumber(1), 0, seqNo});
+      p_sync.m_syncLogic->onChronoSyncUpdate(updates);
+    }
+    else {
+      std::vector<psync::MissingDataInfo> updates;
+      updates.push_back({ndn::Name(prefix), 0, seqNo});
+     p_sync.m_syncLogic->onPSyncUpdate(updates);
+    }
 
     this->advanceClocks(ndn::time::milliseconds(1), 10);
   }
@@ -90,14 +103,19 @@
                                              Lsa::Type::COORDINATE};
 };
 
+using boost::mpl::int_;
+using Protocols = boost::mpl::vector<int_<SYNC_PROTOCOL_CHRONOSYNC>, int_<SYNC_PROTOCOL_PSYNC>>;
+
 BOOST_FIXTURE_TEST_SUITE(TestSyncLogicHandler, SyncLogicFixture)
 
 /* Tests that when SyncLogicHandler receives an LSA of either Name or
    Adjacency type that appears to be newer, it will emit to its signal
    with those LSA details.
  */
-BOOST_AUTO_TEST_CASE(UpdateForOtherLS)
+BOOST_AUTO_TEST_CASE_TEMPLATE(UpdateForOtherLS, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   SyncLogicHandler sync{face, testIsLsaNew, conf};
   sync.createSyncLogic(conf.getChronosyncPrefix());
 
@@ -116,7 +134,7 @@
         BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
       });
 
-    receiveUpdate(updateName, syncSeqNo, sync);
+    receiveUpdate<SyncProtocol::value>(updateName, syncSeqNo, sync);
   }
 }
 
@@ -124,8 +142,10 @@
    either Coordinate or Name type that appears to be newer, it will
    emit to its signal with those LSA details.
  */
-BOOST_AUTO_TEST_CASE(UpdateForOtherHR)
+BOOST_AUTO_TEST_CASE_TEMPLATE(UpdateForOtherHR, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   conf.setHyperbolicState(HYPERBOLIC_STATE_ON);
 
   SyncLogicHandler sync{face, testIsLsaNew, conf};
@@ -144,7 +164,7 @@
         BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
       });
 
-    receiveUpdate(updateName, syncSeqNo, sync);
+    receiveUpdate<SyncProtocol::value>(updateName, syncSeqNo, sync);
   }
 }
 
@@ -152,8 +172,10 @@
    any type that appears to be newer, it will emit to its signal with
    those LSA details.
  */
-BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry)
+BOOST_AUTO_TEST_CASE_TEMPLATE(UpdateForOtherHRDry, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   conf.setHyperbolicState(HYPERBOLIC_STATE_DRY_RUN);
 
   SyncLogicHandler sync{face, testIsLsaNew, conf};
@@ -171,7 +193,7 @@
         BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
       });
 
-    receiveUpdate(updateName, syncSeqNo, sync);
+    receiveUpdate<SyncProtocol::value>(updateName, syncSeqNo, sync);
   }
 }
 
@@ -179,8 +201,10 @@
    details matching this router's details, it will *not* emit to its
    signal those LSA details.
  */
-BOOST_AUTO_TEST_CASE(NoUpdateForSelf)
+BOOST_AUTO_TEST_CASE_TEMPLATE(NoUpdateForSelf, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   const uint64_t sequenceNumber = 1;
 
   SyncLogicHandler sync{face, testIsLsaNew, conf};
@@ -197,7 +221,7 @@
         BOOST_FAIL("Updates for self should not be emitted!");
       });
 
-    receiveUpdate(updateName.toUri(), sequenceNumber, sync);
+    receiveUpdate<SyncProtocol::value>(updateName.toUri(), sequenceNumber, sync);
   }
 }
 
@@ -205,8 +229,10 @@
    details that do not match the expected format, it will *not* emit
    to its signal those LSA details.
  */
-BOOST_AUTO_TEST_CASE(MalformedUpdate)
+BOOST_AUTO_TEST_CASE_TEMPLATE(MalformedUpdate, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   const uint64_t sequenceNumber = 1;
 
   SyncLogicHandler sync{face, testIsLsaNew, conf};
@@ -221,7 +247,7 @@
         BOOST_FAIL("Malformed updates should not be emitted!");
       });
 
-    receiveUpdate(updateName.toUri(), sequenceNumber, sync);
+    receiveUpdate<SyncProtocol::value>(updateName.toUri(), sequenceNumber, sync);
   }
 }
 
@@ -229,8 +255,10 @@
    details that do not appear to be new, it will *not* emit to its
    signal those LSA details.
  */
-BOOST_AUTO_TEST_CASE(LsaNotNew)
+BOOST_AUTO_TEST_CASE_TEMPLATE(LsaNotNew, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
+
   auto testLsaAlwaysFalse = [] (const ndn::Name& routerName, const Lsa::Type& lsaType,
                            const uint64_t& sequenceNumber) {
     return false;
@@ -248,15 +276,16 @@
                            CONFIG_SITE + "/%C1.Router/other-router/" +
                            std::to_string(Lsa::Type::NAME);
 
-  receiveUpdate(updateName, sequenceNumber, sync);
+  receiveUpdate<SyncProtocol::value>(updateName, sequenceNumber, sync);
 }
 
 /* Tests that SyncLogicHandler successfully concatenates configured
    variables together to form the necessary prefixes to advertise
    through ChronoSync.
  */
-BOOST_AUTO_TEST_CASE(UpdatePrefix)
+BOOST_AUTO_TEST_CASE_TEMPLATE(UpdatePrefix, SyncProtocol, Protocols)
 {
+  setSyncProtocol<SyncProtocol::value>();
 
   SyncLogicHandler sync{face, testIsLsaNew, conf};
 
@@ -281,8 +310,9 @@
    NB: This test is as much an Nlsr class test as a
    SyncLogicHandler class test, but it rides the line and ends up here.
  */
-BOOST_AUTO_TEST_CASE(createSyncLogicOnInitialization) // Bug #2649
+BOOST_AUTO_TEST_CASE_TEMPLATE(createSyncLogicOnInitialization, SyncProtocol, Protocols) // Bug #2649
 {
+  setSyncProtocol<SyncProtocol::value>();
   nlsr.initialize();
 
   // Make sure an adjacency LSA has not been built yet
diff --git a/tests/test-sync-protocol-adapter.cpp b/tests/test-sync-protocol-adapter.cpp
new file mode 100644
index 0000000..344f9a0
--- /dev/null
+++ b/tests/test-sync-protocol-adapter.cpp
@@ -0,0 +1,117 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2018,  The University of Memphis,
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
+ *
+ * This file is part of NLSR (Named-data Link State Routing).
+ * See AUTHORS.md for complete list of NLSR authors and contributors.
+ *
+ * NLSR is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "communication/sync-protocol-adapter.hpp"
+#include "test-common.hpp"
+#include "boost-test.hpp"
+
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/vector.hpp>
+
+namespace nlsr {
+namespace test {
+
+using namespace ndn;
+
+class SyncProtocolAdapterFixture : public UnitTestTimeFixture
+{
+public:
+  SyncProtocolAdapterFixture()
+   : syncPrefix("/localhop/ndn/nlsr/sync/")
+   , nameLsaUserPrefix("/localhop/ndn/nlsr/LSA/NAME")
+   , syncInterestLifetime(time::seconds(60))
+  {
+  	syncPrefix.appendVersion(4);
+  }
+
+  template <int32_t T>
+  void
+  addNodes()
+  {
+    for (int i = 0; i < 2; i++) {
+      faces[i] = std::make_shared<ndn::util::DummyClientFace>(m_ioService,
+                                                              util::DummyClientFace::Options{true, true});
+      userPrefixes[i] = Name(nameLsaUserPrefix).appendNumber(i);
+      nodes[i] = std::make_shared<SyncProtocolAdapter>(*faces[i], T, syncPrefix,
+      	                                               userPrefixes[i],
+                                                       syncInterestLifetime,
+                                                       [i, this] (const ndn::Name& updateName,
+                                                                   uint64_t highSeq) {
+                                                         prefixToSeq[i].emplace(updateName, highSeq);
+                                                       });
+    }
+
+    faces[0]->linkTo(*faces[1]);
+    advanceClocks(ndn::time::milliseconds(10), 10);
+  }
+
+public:
+  Name syncPrefix, nameLsaUserPrefix;
+  Name userPrefixes[2];
+  time::milliseconds syncInterestLifetime;
+  std::shared_ptr<ndn::util::DummyClientFace> faces[2];
+  std::shared_ptr<SyncProtocolAdapter> nodes[2];
+  std::map<ndn::Name, uint64_t> prefixToSeq[2];
+};
+
+using boost::mpl::int_;
+using Protocols = boost::mpl::vector<int_<SYNC_PROTOCOL_CHRONOSYNC>, int_<SYNC_PROTOCOL_PSYNC>>;
+
+BOOST_FIXTURE_TEST_SUITE(TestSyncProtocolAdapter, SyncProtocolAdapterFixture)
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(Sync, SyncProtocol, Protocols)
+{
+  addNodes<SyncProtocol::value>();
+
+  nodes[0]->publishUpdate(userPrefixes[0], 10);
+  advanceClocks(ndn::time::milliseconds(1000), 100);
+
+  auto it = prefixToSeq[1].find(userPrefixes[0]);
+  BOOST_CHECK(it != prefixToSeq[1].end());
+  BOOST_CHECK_EQUAL(it->first, userPrefixes[0]);
+  BOOST_CHECK_EQUAL(it->second, 10);
+
+  nodes[1]->publishUpdate(userPrefixes[1], 100);
+  advanceClocks(ndn::time::milliseconds(1000), 100);
+
+  it = prefixToSeq[0].find(userPrefixes[1]);
+  BOOST_CHECK(it != prefixToSeq[0].end());
+  BOOST_CHECK_EQUAL(it->first, userPrefixes[1]);
+  BOOST_CHECK_EQUAL(it->second, 100);
+
+  Name adjLsaUserPrefix("/localhop/ndn/nlsr/LSA/ADJACENCY");
+  nodes[0]->addUserNode(adjLsaUserPrefix);
+  advanceClocks(ndn::time::milliseconds(1000), 100);
+  nodes[0]->publishUpdate(adjLsaUserPrefix, 10);
+  advanceClocks(ndn::time::milliseconds(1000), 100);
+
+  it = prefixToSeq[1].find(adjLsaUserPrefix);
+  BOOST_CHECK(it != prefixToSeq[1].end());
+  BOOST_CHECK_EQUAL(it->first, adjLsaUserPrefix);
+  BOOST_CHECK_EQUAL(it->second, 10);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace nlsr
\ No newline at end of file
