Completing model-checking automation script to process 2 different lists.
[smartthings-infrastructure.git] / ModelCheck.py
index 82c6adffeffe847fe202635448f8659031b161db..6defff69a3b55c00ae600ff8816f5c4bdb3b936e 100644 (file)
@@ -30,6 +30,7 @@ extractAppList.close()
 
 # Try to create pairs
 appPairs = []
+useSecondList = False
 # Extract the second list if provided (this is for combinations between two lists)
 if (len(sys.argv) == 6):
        secondList = sys.argv[5]
@@ -38,15 +39,22 @@ if (len(sys.argv) == 6):
                if '#' not in app:
                        appList2.append(app.strip())
        extractAppList.close()
+       useSecondList = True
 # Just copy the first list to the second list
 else:
        appList2 = appList1
 
-# Generate the permutations of pairs
-for i in range(len(appList1)):
-       for j in range(i + 1, len(appList2)):
-               appPairs.append((appList1[i], appList2[j]))
-
+if useSecondList is False:
+       # Generate the permutations of pairs
+       for i in range(len(appList1)):
+               for j in range(i + 1, len(appList2)):
+                       appPairs.append((appList1[i], appList2[j]))
+else:
+       # Generate pairs from 2 lists
+       for i in range(len(appList1)):
+                       for j in range(len(appList2)):
+                               appPairs.append((appList1[i], appList2[j]))
+                       
 # PART 2: 
 print "PHASE 2: Running JPF ...\n"
 # List down all the log file names