p.add_argument('--usrStats', action="store_const", const=True, default=False,
               help='If set print user stats');
p.add_argument('--lvlset', type=str,
               help='Path to levelset used in experiment', required=True);
p.add_argument('--timeout', type=int, default=10,
               help='Timeout in seconds for z3 queries.')
p.add_argument('--additionalInvs', type=str,
               help='Path to a .csv file with additional invariants.')

def isSrcUser(srcId):
    return srcId != 'verifier'

if __name__ == "__main__":
    args = p.parse_args();

    s = open_sqlite_db("../logs/" + args.ename + "/events.db")()
    lvlsetName, lvls = loadBoogieLvlSet(args.lvlset)

    otherInvs = { }
    if (args.additionalInvs):
      with open(args.additionalInvs) as f:
        r = csv.reader(f, delimiter=",");
        for row in r:
          (lvl, invs) = row
          bInvs = []
          for inv in [x for x in invs.split(";") if len(x.strip()) != 0]:
            try:
              bInv = parseExprAst(inv)
              if (tautology(expr_to_z3(bInv, AllIntTypeEnv()))):
                  continue
              bInvs.append(bInv)
Exemplo n.º 2
0
    help="An optional port number")
  p.add_argument("--db", type=str, required=True,
    help="Path to database")
  p.add_argument("--adminToken", type=str,
    help="Secret token for admin interface; randomly generated if omitted")
  p.add_argument("--experiments", type=str,
    help="Path to experiment configuration file")
  p.add_argument("--email", type=str,
    help="E-mail address to notify for problem reports")

  args = p.parse_args()

  if "mysql+mysqldb://" in args.db:
    sessionF = open_mysql_db(args.db)
  else:
    sessionF = open_sqlite_db(args.db)

  if args.adminToken:
    adminToken = args.adminToken
  else:
    adminToken = randomToken(5)

  mc = mturk_util.connect(args.credentials_file, args.sandbox)
  loadExperiments()

  MYDIR = dirname(abspath(realpath(__file__)))
  ROOT_DIR = dirname(MYDIR)

  if args.local:
    host = "127.0.0.1"
    sslContext = None
Exemplo n.º 3
0
def open_db(path):
    if "mysql+mysqldb://" in path:
        sessionF = open_mysql_db(path)
    else:
        sessionF = open_sqlite_db(path)
    return sessionF
if __name__ == "__main__":
    args = p.parse_args()

    e1 = load_experiment_or_die(args.exp1)
    e1.read_server_runs()
    e2 = load_experiment_or_die(args.exp2)
    e2.read_server_runs()
    try:
        e3 = Experiment(args.out, False)
        print "Error: Experiment ", args.out, "already exists"
        exit(-1)
    except IOError:
        e3 = Experiment(args.out, True)

    s1 = open_sqlite_db("../logs/" + args.exp1 + "/events.db")()
    s2 = open_sqlite_db("../logs/" + args.exp2 + "/events.db")()
    s3 = open_sqlite_db("../logs/" + args.out + "/events.db")()

    # Merging consists of 3 steps:
    # 1) Copy over all ignore-*, tut-done-* and done-* files over in target
    #    directory
    from shutil import copyfile
    from glob import glob

    e1_files = glob(join(e1.dirname, "ignore-*")) +\
               glob(join(e1.dirname, "tut-done*")) +\
               glob(join(e1.dirname, "done-*"))

    e2_files = glob(join(e1.dirname, "ignore-*")) +\
               glob(join(e1.dirname, "tut-done*")) +\
Exemplo n.º 5
0
                   type=str,
                   help='Secret token for logging in to admin interface." +\
                        "If omitted will be randomly generated')
    p.add_argument('--timeout',
                   type=int,
                   default=60,
                   help='Timeout in seconds for z3 queries.')

    args = p.parse_args()

    if (not args.db):
        db = join("..", "logs", args.ename, "events.db")
    else:
        db = args.db

    sessionF = open_sqlite_db(db)

    if (args.adminToken):
        adminToken = args.adminToken
    else:
        adminToken = randomToken(5)

    MYDIR = dirname(abspath(realpath(__file__)))
    ROOT_DIR = dirname(MYDIR)

    curLevelSetName, lvls = loadBoogieLvlSet(args.lvlset)
    traces = {curLevelSetName: lvls}

    print "Admin Token: ", adminToken
    print "Admin URL: ", "admin.html?adminToken=" + adminToken
    app.run(host='0.0.0.0',\