Provide option to run NLSR in dry-run mode

refs: #4326

Change-Id: Icd84ae1f59acadac478e8a3425e21fd02d86bdf8
diff --git a/bin/minindn b/bin/minindn
index f43ae53..07c223f 100755
--- a/bin/minindn
+++ b/bin/minindn
@@ -111,7 +111,7 @@
         self.experimentName = None
         self.nFaces = 3
         self.templateFile = "minindn.conf"
-        self.hr = False
+        self.routingType = "link-state"
         self.isCliEnabled = True
         self.nlsrSecurity = False
         self.nPings = 300
@@ -126,16 +126,13 @@
         self.tunnelType = None
         self.faceType = "udp"
 
-def createResultsDir(resultDir, faces, hr):
+def createResultsDir(resultDir, faces, rType):
     if faces == 0:
         faces = "all"
 
-    if hr:
-        routingType = "/hr/"
-    else:
-        routingType = "/ls/"
+    routingChoice = "/{}/".format(rType)
 
-    resultDir = "%s/%s/faces-%s" % (str(resultDir), routingType, str(faces))
+    resultDir = "{}/{}/faces-{}".format(resultDir, routingChoice, faces)
     resultDir = os.path.abspath(resultDir)
 
     if not os.path.isdir(resultDir):
@@ -163,9 +160,9 @@
     parser.add_argument("--faces", type=int, default=3,
                         help="Specify number of faces 0-60")
 
-    # store_true stores default value of False
-    parser.add_argument("--hr", action="store_true",
-                        help="--hr is used to turn on hyperbolic routing")
+    parser.add_argument("--routing", dest="routingType", default='link-state', choices=['link-state', 'hr', 'dry'],
+                        help="""choices for routing are 'link-state' for link state, 'hr' for hyperbolic, and 'dry'
+                        to test hyperbolic routing and compare with link state. Default is link-state.""")
 
     parser.add_argument("--list-experiments", action=PrintExperimentNames,
                         help="Lists the names of all available experiments")
@@ -176,6 +173,7 @@
     parser.add_argument("--nPings", type=int, default=300,
                         help="Number of pings to perform between each node in the experiment")
 
+    # store_true stores default value of False
     parser.add_argument("--nlsr-security", action="store_true", dest="nlsrSecurity",
                         help="Enables NLSR security")
 
@@ -216,7 +214,7 @@
     options.ctime = args.ctime
     options.experimentName = args.experiment
     options.nFaces = args.faces
-    options.hr = args.hr
+    options.routingType = args.routingType
     options.isCliEnabled = args.isCliEnabled
     options.nlsrSecurity = args.nlsrSecurity
     options.nPings = args.nPings
@@ -342,7 +340,7 @@
                 ssh(login, "sudo cp /tmp/nfd.conf %s" % src)
 
     if options.resultDir is not None:
-        options.resultDir = createResultsDir(options.resultDir, options.nFaces, options.hr)
+        options.resultDir = createResultsDir(options.resultDir, options.nFaces, options.routingType)
 
     topo = NdnTopo(options.templateFile, options.workDir)
 
@@ -401,7 +399,10 @@
         if options.nFaces is not None:
             host.nlsrParameters["max-faces-per-prefix"] = options.nFaces
 
-        if options.hr is True:
+        if options.routingType == 'dry':
+            host.nlsrParameters["hyperbolic-state"] = "dry-run"
+
+        elif options.routingType == 'hr':
             host.nlsrParameters["hyperbolic-state"] = "on"
 
         # Generate NLSR configuration file
diff --git a/docs/GETTING-STARTED.md b/docs/GETTING-STARTED.md
index 205d2eb..84e204e 100644
--- a/docs/GETTING-STARTED.md
+++ b/docs/GETTING-STARTED.md
@@ -59,11 +59,16 @@
 
 #### Routing options
 
-To run NLSR with hyperbolic routing enabled, use the `--hr` parameter:
+To run NLSR with hyperbolic routing enabled, use the `--routing` parameter:
 
-    sudo minindn --hr
+    sudo minindn --routing hr
 
-Topology files given under ndn_utils/topologies/minindn* have hyperbolic coordinates configured and can be used with this option.
+Topology files given under ndn_utils/topologies/minindn* have hyperbolic coordinates configured
+and can be used with this option.
+
+To run NLSR in dry-run mode, use the `--routing` parameter:
+
+    sudo minindn --routing dry
 
 To configure the max number of faces added by NLSR to reach each name prefix, use the `--faces`
 parameter: