 PROCEDURE dfm$kickit, kickit (
  sets, s:integer 1 .. 100 = 2
  tasks_per_job, tpj, tasks, t: integer 1 .. 20 = 1
  total_minutes, tm: integer 1 .. 1000 = 30
  wait_milliseconds, wm: integer = 10000
  update_each_loop, uel: boolean = true
  kickit_option, ko: list of key
    all
    shared
    worksetp
    bigsegp
    krunchp
    krunchn
    iotestp
    sparsep
    shadowp
  keyend = all
  job_class, jc: name = BATCH
  family_name, fn: name = TESTING
  user, u: name = EVAL
  password, pw: (SECURE) name = EVALPW
  establish_condition_handler, ech: boolean = true
  status)

  " This PROCEDURE is provided to provide testing of the the file server
  " or permanent files memory manager requests.
  " This proc submits jobs that do all of the UUTL memory manager tests, that
  " use permanent files.
  " all times here are milliseconds.  See deck osm$misc_test_commands

  var
   worksetp_option: $type(kickit_option) = (worksetp, all)
   bigsegp_option: $type(kickit_option) = (bigsegp, all)
   krunchp_option: $type(kickit_option) = (krunchp, all)
   krunchn_option: $type(kickit_option) = (krunchn, shared, all)
   iotestp_option: $type(kickit_option) = (iotestp, all)
   sparsep_option: $type(kickit_option) = (sparsep, all)
   shadowp_option: $type(kickit_option) = (shadowp, all)
 varend

   total_time =  total_minutes * 60000 " milliseconds per minute"
   total_time_string = $string(total_time)
   waittime_string =  $string(wait_milliseconds)
   page_size_string = $string($mainframe(page_size))
   family_name_string = $string(family_name)
   job_class_string = $string(job_class)
   user_string = $string(user)
   password_string = $string(password)
   handler = $string(establish_condition_handler)

   FOR i = 1 to sets DO

    " Working set test
    IF update_each_loop THEN
      readopt =  '0'
      jn = 'W'
    ELSE
      readopt =  '1'
      jn='R'
    IFEND
    tasks = $string(tasks_per_job)

    IF NOT $nil($intersection(worksetp_option,kickit_option))  THEN
    colt $local.j1   until='      END_JOB' sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string% ..
         JOB_CLASS=%job_class_string%
        " Workset test - pages, totaltime, waittime, readpage (<> 1 means update)
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' WORKSETP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        FOR t = 2 TO %tasks% DO
          exet sp=uutl p='WORKSETP, 100,%total_time_string%, %waittime_string%, %readopt%' tn=$name('task'//$strrep(t))
        FOREND
        exet sp=uutl p='WORKSETP, 100,%total_time_string%, %waittime_string%, %readopt%'
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('WORKSETP'//jn//$strrep(i))
    IFEND

    " Big segment test
    IF NOT $nil($intersection(bigsegp_option,kickit_option))  THEN
    colt $local.j1   until='      END_JOB' sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string% ..
         JOB_CLASS=%job_class_string%
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' BIGSEGP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        " Bigsegp  - byte count
        FOR t = 2 TO %tasks% DO
          exet sp=uutl p='BIGSEGP, 10000000 '    tn=$name('task'//$strrep(t))
        FOREND
        exet sp=uutl p='BIGSEGP, 10000000 '
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('BIGSEGP'//$strrep(i))
    IFEND

    " Krunch test
    IF update_each_loop THEN
      readopt =  '10'
      jn='W'
    ELSE
      readopt =  '0'
      jn='R'
    IFEND
    IF NOT $nil($intersection(krunchp_option,kickit_option))  THEN
    colt $local.j1   until='      END_JOB'  sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string% ..
         JOB_CLASS=%job_class_string%
        " KRUNCHP test - segments, totaltime, waittime, readopt (<> 0 means check + write randomly
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' KRUNCHP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        FOR t = 2 TO %tasks% DO
         exet sp=uutl p='KRUNCHP, 40,%total_time_string%, %waittime_string%, %readopt%'  tn=$name('task'//$strrep(t))
        FOREND
        exet sp=uutl p='KRUNCHP, 40,%total_time_string%, %waittime_string%, %readopt%'
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('KRUNCHP'//jn//$strrep(i))
    IFEND

    IF NOT $nil($intersection(krunchn_option,kickit_option))  THEN
    colt $local.j1   until='      END_JOB'  sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string%   ..
         JOB_CLASS=%job_class_string%
        " KRUNCHN test - segments, totaltime, waittime, readopt (<> 0 means check + write randomly
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' KRUNCHN%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        FOR t = 2 TO %tasks% DO
          exet sp=uutl p='KRUNCHN, 40,%total_time_string%, %waittime_string%, %readopt%'   tn=$name('task'//$strrep(t))
         FOREND
        exet sp=uutl p='KRUNCHN, 40,%total_time_string%, %waittime_string%, %readopt%'
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('KRUNCHN'//jn//$strrep(i))
    IFEND

    IF NOT $nil($intersection(iotestp_option,kickit_option))  THEN
    " IOtest
    colt $local.j1   until='      END_JOB'  sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string% ..
         JOB_CLASS=%job_class_string%
        " Iotestp test - segments, totaltime, waittime, pages per seg
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' IOTESTP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        FOR t = 2 TO %tasks% DO
          TASK RING=6   tn=$name('task'//$strrep(t))
            exet sp=uutl p='IOTESTP, 15  %total_time_string%, %waittime_string%, 20 '
          TASKEND
        FOREND
        TASK RING=6
          exet sp=uutl p='IOTESTP, 15  %total_time_string%, %waittime_string%, 20 '
        TASKEND
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('IOTESTP'//$strrep(i))
    IFEND

    IF NOT $nil($intersection(sparsep_option,kickit_option))  THEN
    " Sparse test
    colt $local.j1   until='      END_JOB'  sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string%   ..
         JOB_CLASS=%job_class_string%
        " Sparse test - segments, totaltime, waittime, page size
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' SPARSEP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        FOR t = 2 TO %tasks% DO
          exet sp=uutl p='SPARSEP, 15  %total_time_string%, %waittime_string%, %page_size_string% '  tn=$name('task'//$strrep(t))
        FOREND
        exet sp=uutl p='SPARSEP, 15  %total_time_string%, %waittime_string%, %page_size_string% '
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('SPARSEP'//$strrep(i))
    IFEND

    IF NOT $nil($intersection(shadowp_option,kickit_option))  THEN
    " Shadow test
    colt $local.j1   until='      END_JOB'  sm='%'
      LOGIN USER=%user_string% PASSWORD=%password_string% FN=%family_name_string%     ..
         JOB_CLASS=%job_class_string%
        " Shadow test - segments, totaltime, waittime, page size
       IF %handler% THEN
         WHEN any_fault do
           reqoa ' SHADOWP%$strrep(i)% failed  '//$condition_name(osv$status.condition)
           display_value osv$status
          logout
          WHENEND
        IFEND
        pass_time = %total_time_string%/5
        FOR t = 2 TO %tasks% DO
          TASK   tn=$name('task'//$strrep(t))
          FOR pass = 1 to 5 do
            exet sp=uutl p='SHADOWP, 15, pass_time, %waittime_string%,  %page_size_string% '
          FOREND
          TASKEND
        FOREND
        FOR pass = 1 to 5 do
          exet sp=uutl p='SHADOWP, 15, pass_time, %waittime_string%,  %page_size_string% '
        FOREND
      LOGOUT
      END_JOB
    submit_job $local.j1 user_job_name=$name('SHADOWP'//$strrep(i))
    IFEND

  FOREND

 PROCEND dfm$kickit
