Commit cf158e90 authored by Jonathan Shahen's avatar Jonathan Shahen

Reorganizing code for better readability, moving log files into separate...

Reorganizing code for better readability, moving log files into separate folder so that they will not appear to be updated every time you run the script
parent 618905d6
......@@ -6,5 +6,6 @@
<classpathentry kind="lib" path="lib/stringtemplate.jar"/>
<classpathentry kind="lib" path="lib/commons-cli-1.2/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.2/commons-lang3-3.3.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-- This NuSMV specification was automatically generated by the
-- RBAC2SMV tool.
MODULE main
VAR
-- This section will contain state variables. For each user, we will have
-- an array.
user0 : array 0..3 of boolean;
user1 : array 0..3 of boolean;
user2 : array 0..3 of boolean;
user3 : array 0..3 of boolean;
user4 : array 0..3 of boolean;
-- This section will contain enumerations for users and actions
act : {ADD, REMOVE};
user : {user0,user1,user2,user3,user4};
admin : {user4};
role : 0 .. 3;
ASSIGN
-- Assigning UA
init(user0[0]) := 0;
init(user0[1]) := 0;
init(user0[2]) := 0;
init(user0[3]) := 0;
init(user1[0]) := 0;
init(user1[1]) := 0;
init(user1[2]) := 0;
init(user1[3]) := 0;
init(user2[0]) := 0;
init(user2[1]) := 0;
init(user2[2]) := 0;
init(user2[3]) := 0;
init(user3[0]) := 0;
init(user3[1]) := 0;
init(user3[2]) := 0;
init(user3[3]) := 0;
init(user4[0]) := 0;
init(user4[1]) := 0;
init(user4[2]) := 0;
init(user4[3]) := 1;
-- This section will contain state transition rules
next(user0[0]) :=
case
user = user0 & admin = user4 & user4[3] = 1 & user0[1]=1 & user0[2]=1 & role = 0 & act = ADD: 1;
user = user0 & admin = user4 & user4[3] = 1 & user0[1]=0 & role = 0 & act = ADD: 1;
user = user0 & admin = user4 & user4[3] = 1 & user0[1]=0 & user0[2]=1 & role = 0 & act = ADD: 1;
1 : user0[0];
esac;
next(user0[1]) :=
case
user = user0 & admin = user4 & user4[3] = 1 & user0[0]=1 & user0[2]=1 & role = 1 & act = ADD: 1;
user = user0 & admin = user4 & user4[3] = 1 & user0[0]=0 & user0[2]=1 & role = 1 & act = ADD: 1;
user = user0 & admin = user4 & user4[3] = 1 & user0[0]=0 & role = 1 & act = ADD: 1;
1 : user0[1];
esac;
next(user0[2]) :=
case
user = user0 & admin = user4 & user4[3] = 1 & user0[0]=1 & user0[1]=1 & role = 2 & act = ADD: 1;
user = user0 & admin = user4 & user4[3] = 1 & user0[0]=1 & user0[1]=0 & role = 2 & act = ADD: 1;
user = user0 & admin = user4 & 0 & role = 2 & act = REMOVE: 0;
1 : user0[2];
esac;
next(user0[3]) := user0[3];
-- Another user
next(user1[0]) :=
case
user = user1 & admin = user4 & user4[3] = 1 & user1[1]=1 & user1[2]=1 & role = 0 & act = ADD: 1;
user = user1 & admin = user4 & user4[3] = 1 & user1[1]=0 & role = 0 & act = ADD: 1;
user = user1 & admin = user4 & user4[3] = 1 & user1[1]=0 & user1[2]=1 & role = 0 & act = ADD: 1;
1 : user1[0];
esac;
next(user1[1]) :=
case
user = user1 & admin = user4 & user4[3] = 1 & user1[0]=1 & user1[2]=1 & role = 1 & act = ADD: 1;
user = user1 & admin = user4 & user4[3] = 1 & user1[0]=0 & user1[2]=1 & role = 1 & act = ADD: 1;
user = user1 & admin = user4 & user4[3] = 1 & user1[0]=0 & role = 1 & act = ADD: 1;
1 : user1[1];
esac;
next(user1[2]) :=
case
user = user1 & admin = user4 & user4[3] = 1 & user1[0]=1 & user1[1]=1 & role = 2 & act = ADD: 1;
user = user1 & admin = user4 & user4[3] = 1 & user1[0]=1 & user1[1]=0 & role = 2 & act = ADD: 1;
user = user1 & admin = user4 & 0 & role = 2 & act = REMOVE: 0;
1 : user1[2];
esac;
next(user1[3]) := user1[3];
-- Another user
next(user2[0]) :=
case
user = user2 & admin = user4 & user4[3] = 1 & user2[1]=1 & user2[2]=1 & role = 0 & act = ADD: 1;
user = user2 & admin = user4 & user4[3] = 1 & user2[1]=0 & role = 0 & act = ADD: 1;
user = user2 & admin = user4 & user4[3] = 1 & user2[1]=0 & user2[2]=1 & role = 0 & act = ADD: 1;
1 : user2[0];
esac;
next(user2[1]) :=
case
user = user2 & admin = user4 & user4[3] = 1 & user2[0]=1 & user2[2]=1 & role = 1 & act = ADD: 1;
user = user2 & admin = user4 & user4[3] = 1 & user2[0]=0 & user2[2]=1 & role = 1 & act = ADD: 1;
user = user2 & admin = user4 & user4[3] = 1 & user2[0]=0 & role = 1 & act = ADD: 1;
1 : user2[1];
esac;
next(user2[2]) :=
case
user = user2 & admin = user4 & user4[3] = 1 & user2[0]=1 & user2[1]=1 & role = 2 & act = ADD: 1;
user = user2 & admin = user4 & user4[3] = 1 & user2[0]=1 & user2[1]=0 & role = 2 & act = ADD: 1;
user = user2 & admin = user4 & 0 & role = 2 & act = REMOVE: 0;
1 : user2[2];
esac;
next(user2[3]) := user2[3];
-- Another user
next(user3[0]) :=
case
user = user3 & admin = user4 & user4[3] = 1 & user3[1]=1 & user3[2]=1 & role = 0 & act = ADD: 1;
user = user3 & admin = user4 & user4[3] = 1 & user3[1]=0 & role = 0 & act = ADD: 1;
user = user3 & admin = user4 & user4[3] = 1 & user3[1]=0 & user3[2]=1 & role = 0 & act = ADD: 1;
1 : user3[0];
esac;
next(user3[1]) :=
case
user = user3 & admin = user4 & user4[3] = 1 & user3[0]=1 & user3[2]=1 & role = 1 & act = ADD: 1;
user = user3 & admin = user4 & user4[3] = 1 & user3[0]=0 & user3[2]=1 & role = 1 & act = ADD: 1;
user = user3 & admin = user4 & user4[3] = 1 & user3[0]=0 & role = 1 & act = ADD: 1;
1 : user3[1];
esac;
next(user3[2]) :=
case
user = user3 & admin = user4 & user4[3] = 1 & user3[0]=1 & user3[1]=1 & role = 2 & act = ADD: 1;
user = user3 & admin = user4 & user4[3] = 1 & user3[0]=1 & user3[1]=0 & role = 2 & act = ADD: 1;
user = user3 & admin = user4 & 0 & role = 2 & act = REMOVE: 0;
1 : user3[2];
esac;
next(user3[3]) := user3[3];
-- Another user
next(user4[0]) :=
case
user = user4 & admin = user4 & user4[3] = 1 & user4[1]=1 & user4[2]=1 & role = 0 & act = ADD: 1;
user = user4 & admin = user4 & user4[3] = 1 & user4[1]=0 & role = 0 & act = ADD: 1;
user = user4 & admin = user4 & user4[3] = 1 & user4[1]=0 & user4[2]=1 & role = 0 & act = ADD: 1;
1 : user4[0];
esac;
next(user4[1]) :=
case
user = user4 & admin = user4 & user4[3] = 1 & user4[0]=1 & user4[2]=1 & role = 1 & act = ADD: 1;
user = user4 & admin = user4 & user4[3] = 1 & user4[0]=0 & user4[2]=1 & role = 1 & act = ADD: 1;
user = user4 & admin = user4 & user4[3] = 1 & user4[0]=0 & role = 1 & act = ADD: 1;
1 : user4[1];
esac;
next(user4[2]) :=
case
user = user4 & admin = user4 & user4[3] = 1 & user4[0]=1 & user4[1]=1 & role = 2 & act = ADD: 1;
user = user4 & admin = user4 & user4[3] = 1 & user4[0]=1 & user4[1]=0 & role = 2 & act = ADD: 1;
user = user4 & admin = user4 & 0 & role = 2 & act = REMOVE: 0;
1 : user4[2];
esac;
next(user4[3]) := user4[3];
-- LTLSPEC
LTLSPEC G (user1[1]=0)
\ No newline at end of file
2014/12/11 04:55:32.093-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Setting the console's maximum width
2014/12/11 04:55:32.109-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Default Line String Used
2014/12/11 04:55:32.110-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] No SMV File included
2014/12/11 04:55:32.110-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SPEC File: ./data/testcases/mixed/test1.spec
2014/12/11 04:55:32.110-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using the default SPEC File Extension: .spec
2014/12/11 04:55:32.110-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/11 04:55:32.110-0500,mohawk.MohawkMain,setupResultOptions,INFO,Results File: latestMohawkResults.csv
2014/12/11 04:55:37.509-0500,mohawk.testing.TestingSuite,onlyConvertSpecToSmvFormat,FINE,specFile: ./data/testcases/mixed/test1.spec
2014/12/28 05:36:10.775-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Setting the console's maximum width
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Default Line String Used
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SMV File: test3.spec.smv
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SPEC File: ./data/testcases/mixed/test3.spec
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using the default SPEC File Extension: .spec
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:36:10.790-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:36:10.791-0500,mohawk.MohawkMain,setupResultOptions,INFO,Results File: latestMohawkResults.csv
2014/12/28 05:36:10.793-0500,mohawk.testing.TestingSuite,runTests(),FINER,ENTRY
2014/12/28 05:36:10.794-0500,mohawk.helper.SMVSpecHelper,addSpecFile,INFO,[FILE IO] Using SPEC File: D:\Work\Masters\workspace\Mohawk 2.0\data\testcases\mixed\test3.spec
2014/12/28 05:36:10.970-0500,mohawk.testing.TestingSuite,runTests,INFO,[COMPLETED] The following spec file is completed testing for mode SMC: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec
2014/12/28 05:36:11.036-0500,mohawk.testing.TestingSuite,runTests,INFO,[COMPLETED] The following spec file is completed testing for mode BMC: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec
2014/12/28 05:36:11.036-0500,mohawk.testing.TestingSuite,runTests(),FINER,RETURN
2014/12/28 05:36:11.037-0500,mohawk.MohawkMain,main,INFO,[TIMING] D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec: 65ms - smvHelper.loadSpecFiles: 1ms - totalTime: 244ms
2014/12/28 05:37:28.621-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Setting the console's maximum width
2014/12/28 05:37:28.637-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Default Line String Used
2014/12/28 05:37:28.638-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SMV File: test3.spec.smv
2014/12/28 05:37:28.638-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SPEC File: ./data/testcases/mixed/test3.spec
2014/12/28 05:37:28.638-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using the default SPEC File Extension: .spec
2014/12/28 05:37:28.638-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:37:28.638-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:37:28.639-0500,mohawk.MohawkMain,setupResultOptions,INFO,Results File: latestMohawkResults.csv
2014/12/28 05:37:28.639-0500,mohawk.MohawkMain,main,INFO,[ACTION] Run paramter detected
2014/12/28 05:37:28.641-0500,mohawk.MohawkMain,main,INFO,[ACTION] Will convert and then execute the testcase provided
2014/12/28 05:37:28.641-0500,mohawk.testing.TestingSuite,runTests(),FINER,ENTRY
2014/12/28 05:37:28.642-0500,mohawk.helper.SMVSpecHelper,addSpecFile,INFO,[FILE IO] Using SPEC File: D:\Work\Masters\workspace\Mohawk 2.0\data\testcases\mixed\test3.spec
2014/12/28 05:39:28.669-0500,mohawk.testing.TestingSuite,runTests,WARNING,[TIMEOUT] Mohawk has timed out for SPEC file: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec
2014/12/28 05:41:28.672-0500,mohawk.testing.TestingSuite,runTests,WARNING,[TIMEOUT] Mohawk has timed out for SPEC file: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec
2014/12/28 05:41:28.672-0500,mohawk.testing.TestingSuite,runTests(),FINER,RETURN
2014/12/28 05:41:28.672-0500,mohawk.MohawkMain,main,INFO,[TIMING] D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\mixed\test3.spec: -120003ms - smvHelper.loadSpecFiles: 1ms - totalTime: 240031ms
2014/12/28 05:40:15.115-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Setting the console's maximum width
2014/12/28 05:40:15.134-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Default Line String Used
2014/12/28 05:40:15.134-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SMV File: pos.test1.spec.smv
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SPEC File: ./data/testcases/positive/test1.spec
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using the default SPEC File Extension: .spec
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,setupResultOptions,INFO,Results File: latestMohawkResults.csv
2014/12/28 05:40:15.135-0500,mohawk.MohawkMain,main,INFO,[ACTION] Run paramter detected
2014/12/28 05:40:15.138-0500,mohawk.MohawkMain,main,INFO,[ACTION] Will convert and then execute the testcase provided
2014/12/28 05:40:15.138-0500,mohawk.testing.TestingSuite,runTests(),FINER,ENTRY
2014/12/28 05:40:15.139-0500,mohawk.helper.SMVSpecHelper,addSpecFile,INFO,[FILE IO] Using SPEC File: D:\Work\Masters\workspace\Mohawk 2.0\data\testcases\positive\test1.spec
2014/12/28 05:40:15.424-0500,mohawk.testing.TestingSuite,runTests,INFO,[COMPLETED] The following spec file is completed testing for mode SMC: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\positive\test1.spec
2014/12/28 05:40:15.489-0500,mohawk.testing.TestingSuite,runTests,INFO,[COMPLETED] The following spec file is completed testing for mode BMC: D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\positive\test1.spec
2014/12/28 05:40:15.490-0500,mohawk.testing.TestingSuite,runTests(),FINER,RETURN
2014/12/28 05:40:15.490-0500,mohawk.MohawkMain,main,INFO,[TIMING] smvHelper.loadSpecFiles: 1ms - totalTime: 352ms - D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\positive\test1.spec: 66ms
2014/12/28 05:59:02.951-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Setting the console's maximum width
2014/12/28 05:59:02.967-0500,mohawk.MohawkMain,setupUserPreferenceOptions,FINE,[OPTION] Default Line String Used
2014/12/28 05:59:02.967-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SMV File: pos.test1.spec.smv
2014/12/28 05:59:02.967-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using a specific SPEC File: ./data/testcases/positive/test1.spec
2014/12/28 05:59:02.968-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Using the default SPEC File Extension: .spec
2014/12/28 05:59:02.968-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:59:02.968-0500,mohawk.MohawkMain,setupSmvSpecOptions,FINE,[OPTION] Bulk SPEC File inclusion: Disabled
2014/12/28 05:59:02.968-0500,mohawk.MohawkMain,setupResultOptions,INFO,Results File: latestMohawkResults.csv
2014/12/28 05:59:02.968-0500,mohawk.MohawkMain,main,INFO,[ACTION] Run paramter detected
2014/12/28 05:59:02.971-0500,mohawk.MohawkMain,main,INFO,[ACTION] Will convert and then execute the testcase provided
2014/12/28 05:59:02.971-0500,mohawk.testing.TestingSuite,runTests(),FINER,ENTRY
2014/12/28 05:59:02.972-0500,mohawk.helper.SMVSpecHelper,addSpecFile,INFO,[FILE IO] Using SPEC File: D:\Work\Masters\workspace\Mohawk 2.0\data\testcases\positive\test1.spec
2014/12/28 05:59:03.260-0500,mohawk.testing.TestingSuite,runTests,INFO,"[COMPLETED] Result: GOAL_REACHABLE, for the following spec file (in mode SMC): D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\positive\test1.spec"
2014/12/28 05:59:03.325-0500,mohawk.testing.TestingSuite,runTests,INFO,"[COMPLETED] Result: GOAL_REACHABLE, for the following spec file (in mode BMC): D:\Work\Masters\workspace\Mohawk 2.0\.\data\testcases\positive\test1.spec"
2014/12/28 05:59:03.325-0500,mohawk.testing.TestingSuite,runTests(),FINER,RETURN
2014/12/28 05:59:03.327-0500,mohawk.MohawkMain,main,INFO,[TIMING] runTests.mainLoop: 353ms - runTests.mainLoop (0): 352ms - smvHelper.loadSpecFiles: 1ms - totalTime: 355ms - runTests.mainLoop (0) - test1.spec (BMC): 65ms - runTests.mainLoop (0) - test1.spec (SMC): 287ms
Roles role0 role1 role10 role9 role17 role20;
Users user0 user1 user2 user3 user4 user5 user6 user7 user8 user9 user10 user11 user12 user13 user14 user15 user16 user17 user18 user19 user20 user21 user22 user23 user24 user25 user26 user27 user28 user29 user30 user31 user32 user33 user34 user35 user36 user37 user38 user39 user40 user41 user42 user43 user44 user45 user46 user47 user48 user49;
UA <user49,role20>;
CR <role20,role1> <role20,role10> <role20,role9> <FALSE,role17>;
CA <role20,TRUE,role0> <role20,role1,role0> <role20,role0&role9&role17,role10> <role20,-role0,role10> <role20,role0&role1,role10>;
ADMIN user49;
SPEC user41 role10;
\ No newline at end of file
Roles role0 role1 role10 role9 role17 role20 role12 role4 role5 role2 role3 role19 role18 role16 role15 role14 role13 role8 role6 role7;
Users user0 user1 user2 user3 user4 user5 user6 user7 user8 user9 user10 user11 user12 user13 user14 user15 user16 user17 user18 user19 user20 user21 user22 user23 user24 user25 user26 user27 user28 user29 user30 user31 user32 user33 user34 user35 user36 user37 user38 user39 user40 user41 user42 user43 user44 user45 user46 user47 user48 user49;
UA <user49,role20>;
CR <role20,role1> <role20,role10> <role20,role3> <role20,role9> <role20,role19> <role20,role18> <role20,role6> <FALSE,role17> <role20,role7> <role20,role15> <role20,role14> <role20,role13>;
CA <role20,TRUE,role0> <role20,role1,role0> <role20,-role1&role19&role14,role0> <role20,role13&role1&role10,role0> <role20,TRUE,role12> <role20,role5&role3,role12> <role20,role13&-role5,role12> <role20,role6&role12,role1> <role20,-role12,role1> <role20,role0&role12,role1> <role20,-role12&role16,role1> <role20,role0&role9&role17,role10> <role20,-role0,role10> <role20,role0&role1,role10> <role20,role12,role4> <role20,-role12&role16,role4> <role20,role12&role3&role19,role4> <role20,role1&-role12&role18,role4> <role20,-role6&role17&role2,role5> <role20,role6,role5> <role20,-role6&role7,role5> <role20,role13&role1&role4,role2> <role20,-role1&role7,role2> <role20,role1&role12,role2> <role20,-role1,role2> <role20,role6,role3> <role20,TRUE,role3> <role20,role1&-role6,role3> <role20,role8&role6&role15,role19> <role20,TRUE,role19> <role20,-role15,role19> <role20,role15,role19> <role20,role12&role5,role18> <role20,role10&-role5,role18> <role20,role5&role16&role15,role18> <role20,role12&-role5&role16,role18> <role20,role4&role14,role17> <role20,-role14,role17> <role20,role14,role17> <role20,role19&-role14,role17> <role20,role0&role13&role12,role16> <role20,role13&-role12,role16> <role20,role17&role12,role16> <role20,-role12&role19&role18,role16> <role20,role2,role15> <role20,role10&-role2,role15> <role20,role0&-role2&role16,role15> <role20,TRUE,role14> <role20,role1&role6&role2,role14> <role20,-role1,role14> <role20,role1,role14> <role20,role2,role13> <role20,-role2&role19&role14,role13> <role20,role4&-role2,role13> <role20,role13,role8> <role20,role13&role15,role8> <role20,role0&-role13,role8> <role20,role6&role4&role19,role9> <role20,-role4&role19,role9> <role20,role4&role2,role9> <role20,-role4,role9> <role20,role4&role5,role6> <role20,-role4,role6> <role20,role4&role5&role2,role6> <role20,role10&-role4&role15,role6> <role20,role9&role5,role7> <role20,role1&-role5,role7> <role20,role5&role3,role7> <role20,role4&-role5&role15,role7>;
ADMIN user49;
SPEC user41 role10;
\ No newline at end of file
Roles role0 role1 role10 role9 role17 role20 role12 role4 role5 role2 role3 role19 role18 role16 role15 role14 role13 role8 role6 role7 role11;
Users user0 user1 user2 user3 user4 user5 user6 user7 user8 user9 user10 user11 user12 user13 user14 user15 user16 user17 user18 user19 user20 user21 user22 user23 user24 user25 user26 user27 user28 user29 user30 user31 user32 user33 user34 user35 user36 user37 user38 user39 user40 user41 user42 user43 user44 user45 user46 user47 user48 user49;
UA <user49,role20>;
CR <role20,role1> <role20,role11> <role20,role10> <role20,role3> <role20,role19> <role20,role18> <FALSE,role17> <role20,role15> <role20,role14> <role20,role13> <role20,role9> <role20,role6> <role20,role7>;
CA <role20,TRUE,role0> <role20,role1,role0> <role20,-role1&role19&role14,role0> <role20,role13&role1&role10,role0> <role20,TRUE,role12> <role20,role5&role3,role12> <role20,role13&-role5,role12> <role20,role6&role12,role1> <role20,-role12,role1> <role20,role0&role12,role1> <role20,-role12&role16,role1> <role20,role2&role19&role15,role11> <role20,role5&-role2&role19,role11> <role20,role2,role11> <role20,-role2,role11> <role20,role0&role9&role17,role10> <role20,-role0,role10> <role20,role0&role1,role10> <role20,role12,role4> <role20,-role12&role16,role4> <role20,role12&role3&role19,role4> <role20,role1&-role12&role18,role4> <role20,role8&role6&role11,role5> <role20,-role6&role17&role2,role5> <role20,role6,role5> <role20,-role6&role7,role5> <role20,role13&role1&role4,role2> <role20,-role1&role7,role2> <role20,role1&role12,role2> <role20,-role1,role2> <role20,role6,role3> <role20,TRUE,role3> <role20,role1&-role6,role3> <role20,role8&role6&role15,role19> <role20,TRUE,role19> <role20,-role15,role19> <role20,role15,role19> <role20,role12&role5,role18> <role20,role10&-role5,role18> <role20,role5&role16&role15,role18> <role20,role12&-role5&role16,role18> <role20,role4&role14,role17> <role20,-role14,role17> <role20,role14,role17> <role20,role19&-role14,role17> <role20,role0&role13&role12,role16> <role20,role13&-role12,role16> <role20,role17&role12,role16> <role20,-role12&role19&role18,role16> <role20,role2,role15> <role20,role10&-role2,role15> <role20,role0&-role2&role16,role15> <role20,TRUE,role14> <role20,role1&role6&role2,role14> <role20,-role1,role14> <role20,role1,role14> <role20,role2,role13> <role20,-role2&role19&role14,role13> <role20,role4&-role2,role13> <role20,role13,role8> <role20,-role13&role11&role2,role8> <role20,role13&role15,role8> <role20,role0&-role13,role8> <role20,role6&role4&role19,role9> <role20,-role4&role19,role9> <role20,role4&role2,role9> <role20,-role4,role9> <role20,role4&role5,role6> <role20,-role4,role6> <role20,role4&role5&role2,role6> <role20,role10&-role4&role15,role6> <role20,role9&role5,role7> <role20,role1&-role5,role7> <role20,role5&role3,role7> <role20,role4&-role5&role15,role7>;
ADMIN user49;
SPEC user41 role10;
\ No newline at end of file
......@@ -48,14 +48,6 @@ public class MohawkMain {
private static TestingResults results;
private static MohawkTiming timing;
public static Level getLoggerLevel() {
return LoggerLevel;
}
public static void setLoggerLevel(Level loggerLevel) {
LoggerLevel = loggerLevel;
}
public static void main(String[] args) {
// create Options object
Options options = new Options();
......@@ -78,6 +70,7 @@ public class MohawkMain {
// Execute the test cases
if (cmd.hasOption("run")) {
logger.info("[ACTION] Run paramter detected");
results = new TestingResults(resultsFile);
timing = new MohawkTiming();
tests = new TestingSuite(SMV_helper, results, timing);
......@@ -85,9 +78,11 @@ public class MohawkMain {
String runVal = cmd.getOptionValue("run");
switch (runVal) {
case "all":
logger.info("[ACTION] Will convert and then execute the testcase provided");
tests.runTests();
break;
case "smv":
logger.info("[ACTION] Will only convert the testcase provided");
tests.onlyConvertSpecToSmvFormat();
break;
default:
......@@ -113,6 +108,14 @@ public class MohawkMain {
}
}
public static Level getLoggerLevel() {
return LoggerLevel;
}
public static void setLoggerLevel(Level loggerLevel) {
LoggerLevel = loggerLevel;
}
@SuppressWarnings("static-access")
private static void setupOptions(Options options, String[] args) {
// Add Information Options
......
package mohawk;
import java.io.File;
import java.io.IOException;
public class Replicate {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
if (args.length < 2) {
System.out
.println("Usage: java -jar ./rbac2smv.jar Slicer rbacspec nusmvfile");
}
File rbacfile = new File(args[0]);
if (!rbacfile.exists()) {
System.out.println("The RBAC specification file " + rbacfile
+ " does not exists.");
return;
}
String nusmvfile = args[1];
int times = Integer.parseInt(args[2]);
RBACSpecReader rbacreader = new RBACSpecReader(args[0]);
RBACInstance rbac = rbacreader.getRBAC();
Replicator replica = new Replicator(rbac);
RBACInstance newrbac = replica.replicatePolicy(times);
WriteRBACSpec writer = new WriteRBACSpec("rbac.st");
try {
writer.Write2File(newrbac, nusmvfile);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
......@@ -7,7 +7,8 @@
package mohawk.collections;
import java.util.Map;
import mohawk.PreCondition;
import mohawk.pieces.PreCondition;
/**
* @author kjayaram
......
......@@ -5,10 +5,10 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Logger;
import mohawk.RBACInstance;
import mohawk.RBACSpecReader;
import mohawk.RolesAbsRefine;
import mohawk.WriteNuSMV;
import mohawk.output.WriteNuSMV;
import mohawk.rbac.RBACInstance;
import mohawk.rbac.RBACSpecReader;
import mohawk.refine.RolesAbsRefine;
public class SMVSpecHelper {
public final static Logger logger = Logger.getLogger("mohawk");
......
......@@ -44,7 +44,12 @@ public class MohawkConsoleFormatter extends Formatter {
// Message
builder.append(formatMessage(record));
builder.append("\n"); // End of Message
return WordUtils.wrap(builder.toString(), maxWidth, newLineStr, true);
if (maxWidth == 0) {
return builder.toString();
} else {
return WordUtils.wrap(builder.toString(), maxWidth, newLineStr,
true);
}
}
/**
......
/**
*
*/
package mohawk;
package mohawk.math;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import mohawk.rbac.RBACInstance;
import mohawk.rbac.RBACSpecReader;
/**
* @author kjayaram
*
......
/**
*
*/
package mohawk;
package mohawk.math;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
import mohawk.pieces.CAEntry;
import mohawk.rbac.RBACInstance;
/**
* @author kjayaram
*
......
/**
*
*/
package mohawk;
package mohawk.math;
import java.util.HashSet;
import java.util.Iterator;
......@@ -9,6 +9,11 @@ import java.util.Map;
import java.util.Set;
import java.util.Vector;
import mohawk.pieces.CAEntry;
import mohawk.pieces.CREntry;
import mohawk.pieces.PreCondition;
import mohawk.rbac.RBACInstance;
/**
* @author kjayaram
*
......
/**
*
*/
package mohawk;
package mohawk.math;
import java.util.HashSet;
import java.util.Iterator;
......@@ -9,6 +9,10 @@ import java.util.LinkedList;
import java.util.Set;
import java.util.Vector;
import mohawk.pieces.CAEntry;
import mohawk.pieces.PreCondition;
import mohawk.rbac.RBACInstance;
/**
* @author kjayaram
*
......
......@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
package mohawk;
package mohawk.math;
import java.util.HashSet;
import java.util.Iterator;
......@@ -30,6 +30,9 @@ import java.util.Map;
import java.util.Vector;
import mohawk.collections.RoleDepTree;
import mohawk.pieces.CAEntry;
import mohawk.pieces.PreCondition;
import mohawk.rbac.RBACInstance;
/**
* @author kjayaram
......
......@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
package mohawk;
package mohawk.nusmv;
import java.io.BufferedReader;
import java.io.IOException;
......
......@@ -25,12 +25,14 @@
/**
* This class converts from a plain RBAC spec to RBACPAT format
*/
package mohawk;
package mohawk.output;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import mohawk.rbac.RBACPAT;
/**
* @author Karthick Jayaraman
*
......
......@@ -4,7 +4,7 @@
*
* Author: Karthick Jayaraman
*/
package mohawk;
package mohawk.output;
import java.io.BufferedReader;
import java.io.FileWriter;
......@@ -14,6 +14,11 @@ import java.io.InputStreamReader;
import java.util.Map;
import java.util.Vector;
import mohawk.pieces.CAEntry;
import mohawk.pieces.CREntry;
import mohawk.pieces.PreCondition;
import mohawk.rbac.RBACInstance;
import org.antlr.stringtemplate.StringTemplate;
/*
......@@ -406,7 +411,7 @@ public class WriteNuSMV {
done = true;
}
String getNuSMVCode() {
public String getNuSMVCode() {
return this.smvcode;
}
......
/**
* Tool for generating RBAC policy specification.
*/
package mohawk;
package mohawk.output;
import java.io.BufferedReader;
import java.io.FileWriter;
......@@ -12,6 +12,11 @@ import java.util.Map;
import java.util.Random;
import java.util.Vector;
import mohawk.pieces.CAEntry;
import mohawk.pieces.CREntry;
import mohawk.pieces.PreCondition;
import mohawk.rbac.RBACInstance;
import org.antlr.stringtemplate.*;
/**
......