Ejemplo n.º 1
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
                                   parents=[testClientParser])
  parser.add_argument('-p', '--patchFileDir', required=True,
        help='input file path to the folder that contains all the FOIA patches')
  parser.add_argument('-l', '--logDir', required=True,
                      help='Output dirctory to store all log file information')
  parser.add_argument('-i', '--install', default=False, action="store_true",
                      help = 'whether to install Patch or not')
  group = parser.add_mutually_exclusive_group()
  group.add_argument('-n', '--numOfPatch', default=1,
                     help="input All for all patches, "
                          "otherwise just enter number, default is 1")
  group.add_argument('-u', '--upToPatch',
                     help="install patches up to specified install name")
  group.add_argument('-o', '--onlyPatch',
                     help='install specified patch and required patches only'
                          ', this option will ignore the CSV dependencies')
  parser.add_argument('-d', '--duz', default=17, type=int,
                help='installer\'s VistA instance\'s DUZ')

  result = parser.parse_args();
  print (result)
  inputPatchDir = result.patchFileDir
  assert os.path.exists(inputPatchDir)
  outputDir = result.logDir
  assert os.path.exists(outputDir)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  testClient2 = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  initConsoleLogging()
  with testClient as vistAClient:
    patchSeqApply = PatchSequenceApply(vistAClient, outputDir)
    patchSeqApply._duz = result.duz
    assert testClient2
    with testClient2 as vistAClient2:
      patchSeqApply._testClient2 = vistAClient2
      if result.upToPatch:
        patchSeqApply.generatePatchSequence(inputPatchDir,
                                                 result.upToPatch, True)
      else:
        patchSeqApply.generatePatchSequence(inputPatchDir, result.onlyPatch)
      if result.install:
        if result.onlyPatch:
          patchSeqApply.applyPatchSequenceByNumber("All")
        elif result.upToPatch:
          patchSeqApply.applyPatchSequenceByInstallName(result.upToPatch)
        else:
          patchSeqApply.applyPatchSequenceByNumber(result.numOfPatch)
Ejemplo n.º 2
0
def testMountDisMountLocalDb():
    from VistATestClient import createTestClientArgParser
    from VistATestClient import VistATestClientFactory

    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(
        description='InterSystem Cache Mount Dismount Test',
        parents=[testClientParser])
    parser.add_argument('-p',
                        '--dirPath',
                        required=True,
                        help='Enter directory path for the local database')
    parser.add_argument(
        '-a',
        '--action',
        choices=['M', 'D'],
        required=True,
        type=str,
        help='M: mount the database, D: dismount the database. '
        'Make sure InterSystem ^DATABASE routine is accessable via'
        ' specified namespace.')
    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    with testClient:
        if result.action == 'D':
            logging.info('Dismount LocalDB: %s' % result.dirPath)
            dismountLocalDatabase(result.dirPath, testClient)
        else:
            logging.info('mount LocalDB: %s' % result.dirPath)
            mountLocalDatabase(result.dirPath, testClient)
Ejemplo n.º 3
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='Default KIDS Installer',
                                   parents=[testClientParser])
  parser.add_argument('kidsFile', metavar='K', help='path to KIDS Build file')
  parser.add_argument('installName', metavar='I', help='kids install name')
  parser.add_argument('-l', '--logFile', default=None, help='path to logFile')
  parser.add_argument('-r', '--reinstall', default=False, action='store_true',
                help='whether re-install the KIDS even it is already installed')
  parser.add_argument('-m', '--multiBuildList', default=None, nargs='*',
                      help='list of multibuild install names')
  parser.add_argument('-g', '--globalFiles', default=None, nargs='*',
                      help='list of global files that need to import')

  result = parser.parse_args();
  print (result)
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  initConsoleLogging()
  with testClient:
    kidsFile = os.path.abspath(result.kidsFile)
    defaultKidsInstall = DefaultKIDSPatchInstaller(kidsFile,
                                           result.installName,
                                           logFile=result.logFile,
                                           multiBuildList=result.multiBuildList,
                                           globals=result.globalFiles)
    defaultKidsInstall.runInstallation(testClient, result.reinstall)
Ejemplo n.º 4
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='VistA M Component Extractor',
                                     parents=[testClientParser])
    parser.add_argument('-o',
                        '--outputDir',
                        required=True,
                        help='output Dir to store global/routine export files')
    parser.add_argument('-r',
                        '--vistARepo',
                        required=True,
                        help='path to the top directory of VistA-M repository')
    parser.add_argument(
        '-l',
        '--logDir',
        required=True,
        help='path to the top directory to store the log files')
    parser.add_argument(
        '-ro',
        '--routineOutDir',
        default=None,
        help='path to the directory where GT. M stores routines')
    result = parser.parse_args()
    print(result)
    outputDir = result.outputDir
    assert os.path.exists(outputDir)
    initConsoleLogging()
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        vistADataExtractor = VistADataExtractor(result.vistARepo, outputDir,
                                                result.logDir,
                                                result.routineOutDir)
        vistADataExtractor.extractData(testClient)
Ejemplo n.º 5
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Data Extractor',
                                   parents=[testClientParser])
  parser.add_argument('-o', '--outputDir', required=True,
                      help='output Dir to store global/routine export files')
  parser.add_argument('-r', '--vistARepo', required=True,
                    help='path to the top directory of VistA-FOIA repository')
  parser.add_argument('-l', '--logDir', required=True,
                      help='path to the top directory to store the log files')
  parser.add_argument('-ro', '--routineOutDir', default=None,
                help='path to the directory where GT. M stores routines')
  result = parser.parse_args();
  print (result)
  outputDir = result.outputDir
  assert os.path.exists(outputDir)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    vistADataExtractor = VistADataExtractor(result.vistARepo,
                                            outputDir,
                                            result.logDir,
                                            result.routineOutDir)
    vistADataExtractor.extractData(testClient)
Ejemplo n.º 6
0
def createTestClient():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="VistA Patch Info Query", parents=[testClientParser])
    result = parser.parse_args()
    print (result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    return testClient
Ejemplo n.º 7
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
                                     parents=[testClientParser])
    parser.add_argument('-f', '--foiaBranch', required=True,
          help='input the branch name from which the global files are downloaded')
    parser.add_argument('-r', '--foiaRemote', required=False, default="https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/",
          help='input the VistA-M repository from which the global files are downloaded, must be a link to the raw data.\
          Default remote is: https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/ ')
    parser.add_argument('-t', '--tmpDir', required=True,
          help='input the filepath to a directory to download the necessary global files')
    parser.add_argument('-g', '--gtmDir', required=False,
          help='input the filepath to a directory where GT.M stores its routines')
    parser.add_argument('-i', '--install', required=False, action="store_true",
          help='Attempt to install global files with ^ZGI?')
    parser.add_argument('-l', '--log', required=False,
          help='File to which I would log VistA communication')
    result = parser.parse_args();

    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    initConsoleLogging()
    if result.log: testClient.setLogFile(result.log)
    with testClient as vistaClient:
      update = updateMFSGlobals()
      update.updateMFSGlobalFiles(vistaClient,result.foiaBranch, result.foiaRemote,result.tmpDir, result.gtmDir, result.install)
Ejemplo n.º 8
0
def testMountDisMountLocalDb():
    from VistATestClient import createTestClientArgParser
    from VistATestClient import VistATestClientFactory

    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="InterSystem Cache Mount Dismount Test", parents=[testClientParser])
    parser.add_argument("-p", "--dirPath", required=True, help="Enter directory path for the local database")
    parser.add_argument(
        "-a",
        "--action",
        choices=["M", "D"],
        required=True,
        type=str,
        help="M: mount the database, D: dismount the database. "
        "Make sure InterSystem ^DATABASE routine is accessable via"
        " specified namespace.",
    )
    result = parser.parse_args()
    print result
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    with testClient:
        if result.action == "D":
            logging.info("Dismount LocalDB: %s" % result.dirPath)
            dismountLocalDatabase(result.dirPath, testClient)
        else:
            logging.info("mount LocalDB: %s" % result.dirPath)
            mountLocalDatabase(result.dirPath, testClient)
Ejemplo n.º 9
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA M Component Extractor',
                                   parents=[testClientParser])
  parser.add_argument('-o', '--outputDir', required=True,
                      help='output Dir to store global/routine export files')
  parser.add_argument('-r', '--vistARepo', required=True,
                    help='path to the top directory of VistA-M repository')
  parser.add_argument('-l', '--logDir', required=True,
                      help='path to the top directory to store the log files')
  parser.add_argument('-ro', '--routineOutDir', default=None,
                help='path to the directory where GT. M stores routines')
  parser.add_argument('-sx', '--serialize', default=False, action="store_true",
                      help = 'export the globals serially (Needed on on single-user Cache instace)')
  result = parser.parse_args();
  print (result)
  outputDir = result.outputDir
  assert os.path.exists(outputDir)
  initConsoleLogging()
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    vistADataExtractor = VistADataExtractor(result.vistARepo,
                                            outputDir,
                                            result.logDir,
                                            result.routineOutDir,
                                            serialExport = result.serialize)
    vistADataExtractor.extractData(testClient)
Ejemplo n.º 10
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Routine Export',
                                   parents=[testClientParser])
  parser.add_argument('-o', '--outputFile',
                    help='Output File Name to store routine export information')
  parser.add_argument('-a', '--allRoutines', action="store_true", default=False,
                      help='export all routines')
  parser.add_argument('-r', '--routines', nargs='*',
                      help='only specified routine names')
  parser.add_argument('-e', '--exclude', nargs='*', default=None,
                      help='exclude specified routine names')
  result = parser.parse_args();
  print (result)
  outputFilename = result.outputFile
  outputDir = os.path.dirname(outputFilename)
  assert os.path.exists(outputDir)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME)
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    isAllRoutines = result.allRoutines
    vistARoutineExport = VistARoutineExport()
    if isAllRoutines:
      vistARoutineExport.exportAllRoutines(vistAClient, outputFilename,
                                           result.exclude)
    else:
      vistARoutineExport.exportRoutines(vistAClient, outputFilename,
                                        result.routines,
                                        result.exclude)
Ejemplo n.º 11
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='Default KIDS Installer',
                                   parents=[testClientParser])
  parser.add_argument('kidsFile', help='path to KIDS Build file')
  parser.add_argument('-l', '--logFile', default=None, help='path to logFile')
  parser.add_argument('-r', '--reinstall', default=False, action='store_true',
                help='whether re-install the KIDS even it is already installed')
  parser.add_argument('-g', '--globalFiles', default=None, nargs='*',
                      help='list of global files that need to import')

  result = parser.parse_args();
  print (result)
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  initConsoleLogging()
  with testClient:
    kidsFile = os.path.abspath(result.kidsFile)
    from KIDSBuildParser import KIDSBuildParser
    kidsParser = KIDSBuildParser(None)
    kidsParser.unregisterSectionHandler(KIDSBuildParser.ROUTINE_SECTION)
    kidsParser.parseKIDSBuild(kidsFile)
    installNameList = kidsParser.installNameList
    installName = installNameList[0]
    multiBuildList = installNameList
    if len(installNameList) == 1:
      multiBuildList = None
    defaultKidsInstall = DefaultKIDSBuildInstaller(kidsFile,
                                           installName,
                                           logFile=result.logFile,
                                           multiBuildList=multiBuildList,
                                           globals=result.globalFiles)
    defaultKidsInstall.runInstallation(testClient, result.reinstall)
Ejemplo n.º 12
0
def createTestClient():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="Default KIDS Installer", parents=[testClientParser])
    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    return testClient
Ejemplo n.º 13
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
                                   parents=[testClientParser])
  parser.add_argument('-p', '--patchFileDir', required=True,
        help='input file path to the folder that contains all the FOIA patches')
  parser.add_argument('-l', '--logDir', required=True,
                      help='Output dirctory to store all log file information')
  parser.add_argument('-i', '--install', default=False, action="store_true",
                      help = 'whether to install KIDS Patch or not')
  parser.add_argument('-n', '--numOfPatch', required=False, default=1,
    help="input All for all patches, otherwise just enter number, default is 1")
  result = parser.parse_args();
  print (result)
  inputPatchDir = result.patchFileDir
  assert os.path.exists(inputPatchDir)
  outputDir = result.logDir
  assert os.path.exists(outputDir)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    kidsPatchApply = KIDSPatchSequenceApply(vistAClient, outputDir)
    kidsPatchApply.generateKIDSPatchSequence(inputPatchDir)
    if result.install:
      kidsPatchApply.applyKIDSPatchSequence(result.numOfPatch)
Ejemplo n.º 14
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="VistA Routine Export", parents=[testClientParser])
    parser.add_argument("-o", "--outputFile", help="Output File Name to store routine export information")
    parser.add_argument("-a", "--allRoutines", action="store_true", default=False, help="export all routines")
    parser.add_argument("-r", "--routines", nargs="*", help="only specified routine names")
    parser.add_argument("-e", "--exclude", nargs="*", default=None, help="exclude specified routine names")
    result = parser.parse_args()
    print (result)
    outputFilename = result.outputFile
    outputDir = os.path.dirname(outputFilename)
    assert os.path.exists(outputDir)
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        logFilename = getTempLogFile()
        print "Log File is %s" % logFilename
        vistAClient.setLogFile(logFilename)
        isAllRoutines = result.allRoutines
        vistARoutineExport = VistARoutineExport()
        if isAllRoutines:
            vistARoutineExport.exportAllRoutines(vistAClient, outputFilename, result.exclude)
        else:
            vistARoutineExport.exportRoutines(vistAClient, outputFilename, result.routines, result.exclude)
Ejemplo n.º 15
0
def main():
    import logging
    initConsoleLogging(logging.INFO)
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='VistA Taskman Utilities',
                                     parents=[testClientParser])
    parser.add_argument(
        '-a',
        '--action',
        required=True,
        choices=['Start', 'Stop', 'Shutdown'],
        help=
        'Start:Start Taskman, Stop:Stop Taskman, Shutdown:Shutdown all tasks')
    result = parser.parse_args()
    print result
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        logFilename = getTempLogFile()
        print "Log File is %s" % logFilename
        vistAClient.setLogFile(logFilename)
        taskmanUtil = VistATaskmanUtil()
        actionMap = {
            "Start": taskmanUtil.startTaskman,
            "Stop": taskmanUtil.stopTaskman,
            "Shutdown": taskmanUtil.shutdownAllTasks
        }
        actionMap[result.action](vistAClient)
Ejemplo n.º 16
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(
        description='FOIA Patch Sequence Analyzer', parents=[testClientParser])
    parser.add_argument(
        '-p',
        '--patchFileDir',
        required=True,
        help='input file path to the folder that contains all the FOIA patches'
    )
    parser.add_argument(
        '-l',
        '--logDir',
        required=True,
        help='Output dirctory to store all log file information')
    parser.add_argument('-i',
                        '--install',
                        default=False,
                        action="store_true",
                        help='whether to install Patch or not')
    group = parser.add_mutually_exclusive_group()
    group.add_argument('-n',
                       '--numOfPatch',
                       default=1,
                       help="input All for all patches, "
                       "otherwise just enter number, default is 1")
    group.add_argument('-u',
                       '--upToPatch',
                       help="install patches up to specified install name")
    group.add_argument('-o',
                       '--onlyPatch',
                       help='install specified patch and required patches only'
                       ', this option will ignore the CSV dependencies')

    result = parser.parse_args()
    print(result)
    inputPatchDir = result.patchFileDir
    assert os.path.exists(inputPatchDir)
    outputDir = result.logDir
    assert os.path.exists(outputDir)
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    initConsoleLogging()
    with testClient as vistAClient:
        patchSeqApply = PatchSequenceApply(vistAClient, outputDir)
        if result.upToPatch:
            patchSeqApply.generatePatchSequence(inputPatchDir,
                                                result.upToPatch, True)
        else:
            patchSeqApply.generatePatchSequence(inputPatchDir,
                                                result.onlyPatch)
        if result.install:
            if result.onlyPatch:
                patchSeqApply.applyPatchSequenceByNumber("All")
            elif result.upToPatch:
                patchSeqApply.applyPatchSequenceByInstallName(result.upToPatch)
            else:
                patchSeqApply.applyPatchSequenceByNumber(result.numOfPatch)
Ejemplo n.º 17
0
def createTestClient():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='Default KIDS Installer',
                                     parents=[testClientParser])
    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    return testClient
Ejemplo n.º 18
0
def createTestClient():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='VistA Patch Info Query',
                                     parents=[testClientParser])
    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    return testClient
Ejemplo n.º 19
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='Default KIDS Installer',
                                     parents=[testClientParser])
    parser.add_argument('kidsFile', help='path to KIDS Build file')
    parser.add_argument('-l',
                        '--logFile',
                        default=None,
                        help='path to logFile')
    parser.add_argument(
        '-r',
        '--reinstall',
        default=False,
        action='store_true',
        help='whether re-install the KIDS even it is already installed')
    parser.add_argument(
        '-t',
        '--tglobalprint',
        default=None,
        help='folder to hold a printout of Transport global information')
    parser.add_argument('-g',
                        '--globalFiles',
                        default=None,
                        nargs='*',
                        help='list of global files that need to import')
    parser.add_argument('-d',
                        '--duz',
                        default=DEFAULT_INSTALL_DUZ,
                        type=int,
                        help='installer\'s VistA instance\'s DUZ')

    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    initConsoleLogging()
    with testClient:
        kidsFile = os.path.abspath(result.kidsFile)
        from KIDSBuildParser import KIDSBuildParser
        kidsParser = KIDSBuildParser(None)
        kidsParser.unregisterSectionHandler(KIDSBuildParser.ROUTINE_SECTION)
        kidsParser.parseKIDSBuild(kidsFile)
        installNameList = kidsParser.installNameList
        installName = installNameList[0]
        multiBuildList = installNameList
        if len(installNameList) == 1:
            multiBuildList = None
        defaultKidsInstall = DefaultKIDSBuildInstaller(
            kidsFile,
            installName,
            logFile=result.logFile,
            multiBuildList=multiBuildList,
            duz=result.duz,
            globals=result.globalFiles,
            printTG=result.tglobalprint)
        defaultKidsInstall.runInstallation(testClient, result.reinstall)
Ejemplo n.º 20
0
def test_exportAllClassesIndividual():
  from VistATestClient import createTestClientArgParser
  from VistATestClient import VistATestClientFactory
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='Intersystem Cache Classes Exporter',
                                   parents=[testClientParser])
  parser.add_argument('dstDir', help='Output directory to store all exported classes')
  result = parser.parse_args()
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  with testClient:
    exportAllClassesIndividual(testClient, result.dstDir)
Ejemplo n.º 21
0
def test_importDir():
  from VistATestClient import createTestClientArgParser
  from VistATestClient import VistATestClientFactory
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='Intersystem Cache Classes Importer',
                                   parents=[testClientParser])
  parser.add_argument('srcDir', help='source directory that stores all exported classes')
  result = parser.parse_args()
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  with testClient:
    importDir(testClient, result.srcDir)
Ejemplo n.º 22
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(
        description='FOIA Patch Sequence Analyzer', parents=[testClientParser])
    parser.add_argument(
        '-f',
        '--foiaBranch',
        required=True,
        help='input the branch name from which the global files are downloaded'
    )
    parser.add_argument(
        '-r',
        '--foiaRemote',
        required=False,
        default="https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/",
        help=
        'input the VistA-M repository from which the global files are downloaded, must be a link to the raw data.\
          Default remote is: https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/ '
    )
    parser.add_argument(
        '-t',
        '--tmpDir',
        required=True,
        help=
        'input the filepath to a directory to download the necessary global files'
    )
    parser.add_argument(
        '-g',
        '--gtmDir',
        required=False,
        help='input the filepath to a directory where GT.M stores its routines'
    )
    parser.add_argument('-i',
                        '--install',
                        required=False,
                        action="store_true",
                        help='Attempt to install global files with ^ZGI?')
    parser.add_argument('-l',
                        '--log',
                        required=False,
                        help='File to which I would log VistA communication')
    result = parser.parse_args()
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    initConsoleLogging()
    if result.log: testClient.setLogFile(result.log)
    with testClient as vistaClient:
        update = updateMFSGlobals()
        update.updateMFSGlobalFiles(vistaClient, result.foiaBranch,
                                    result.foiaRemote, result.tmpDir,
                                    result.gtmDir, result.install)
  def dispatch(self):
#    expectConn = VistATestClientFactory.createVistATestClient(self._system, namespace=self._namespace)
#    if not expectConn:
#      return
#    FileManGlobalAttributes.listFileManFileAttributes(expectConn, self._fileManFile, 3,
#                              os.path.join(self._logDir, self._fileManFile + ".custom"),
#                              os.path.join(self._logDir, self._fileManFile + ".customlog"))
    expectConn = VistATestClientFactory.createVistATestClient(self._system, namespace=self._namespace)
    if not expectConn:
      return
    FileManGlobalAttributes.listFileManFileAttributes(expectConn, self._fileManFile, 1,
                              os.path.join(self._logDir, self._fileManFile + ".schema"),
                              os.path.join(self._logDir, self._fileManFile + ".log"))
Ejemplo n.º 24
0
def test_exportAllClassesIndividual():
    from VistATestClient import createTestClientArgParser
    from VistATestClient import VistATestClientFactory
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(
        description='Intersystem Cache Classes Exporter',
        parents=[testClientParser])
    parser.add_argument('dstDir',
                        help='Output directory to store all exported classes')
    result = parser.parse_args()
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    with testClient:
        exportAllClassesIndividual(testClient, result.dstDir)
Ejemplo n.º 25
0
def test_importDir():
    from VistATestClient import createTestClientArgParser
    from VistATestClient import VistATestClientFactory
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(
        description='Intersystem Cache Classes Importer',
        parents=[testClientParser])
    parser.add_argument(
        'srcDir', help='source directory that stores all exported classes')
    result = parser.parse_args()
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    with testClient:
        importDir(testClient, result.srcDir)
 def _createTestClient(self):
   testClientConfig = self._config['VistA_Connection']
   system = testClientConfig['system']
   namespace = testClientConfig.get('namespace', DEFAULT_NAMESPACE)
   username = testClientConfig.get('username', None)
   password = testClientConfig.get('password', None)
   prompt = testClientConfig.get('prompt', None)
   return VistATestClientFactory.createVistATestClient(system,
                                          prompt=prompt,
                                          namespace=namespace,
                                          instance=self._instance,
                                          username=username,
                                          password=password)
def test1():
    result = getInputArgumentResult()
    outputDir = result.outputDir
    assert os.path.exists(outputDir)
    initConsoleLogging()
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        vistADataExtractor = VistADataExtractor(result.vistARepo, outputDir,
                                                result.logDir,
                                                result.routineOutDir)
        vistADataExtractor.__exportAllCacheClasses__(testClient)
Ejemplo n.º 28
0
def main():
    # Import Argparse and add Scripts/ directory to sys.path
    # by finding directory of current script and going up two levels
    import argparse
    curDir = os.path.dirname(os.path.abspath(__file__))
    scriptDir = os.path.normpath(os.path.join(curDir, "../../"))
    if scriptDir not in sys.path:
        sys.path.append(scriptDir)

    # OSEHRA Imports
    from RPCBrokerCheck import CheckRPCListener
    from VistATestClient import createTestClientArgParser, VistATestClientFactory

    # Arg Parser to get address and port of RPC Listener along with a log file
    # Inherits the connection arguments of the testClientParser

    testClientParser = createTestClientArgParser()
    ssepTestParser = argparse.ArgumentParser(
        description='Test the M2M broker via XML files',
        parents=[testClientParser])
    ssepTestParser.add_argument(
        "-ha",
        required=True,
        dest='host',
        help='Address of the host where RPC Broker is listening')
    ssepTestParser.add_argument(
        "-hp",
        required=True,
        dest='port',
        help='Port of the host machine where RPC Broker is listening')
    ssepTestParser.add_argument("-l",
                                required=True,
                                dest='log_file',
                                help='Path to a file to log the output.')

    # A global variable so that each test is able to use the port and address of the host
    global results
    results = ssepTestParser.parse_args()
    testClient = VistATestClientFactory.createVistATestClientWithArgs(results)
    assert testClient
    with testClient:
        # If checkresult == 0, RPC listener is set up correctly and tests should be run
        # else, don't bother running the tests
        testClient.setLogFile(results.log_file)
        checkresult = CheckRPCListener(testClient.getConnection(),
                                       results.host, results.port)
    if checkresult == 0:
        suite = unittest.TestLoader().loadTestsFromTestCase(TestM2MBroker)
        unittest.TextTestRunner(verbosity=2).run(suite)
    else:
        print "FAILED: The RPC listener is not set up as needed."
Ejemplo n.º 29
0
def test1():
  result = getInputArgumentResult()
  outputDir = result.outputDir
  assert os.path.exists(outputDir)
  initConsoleLogging()
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    vistADataExtractor = VistADataExtractor(result.vistARepo,
                                            outputDir,
                                            result.logDir,
                                            result.routineOutDir)
    vistADataExtractor.__exportAllCacheClasses__(testClient)
Ejemplo n.º 30
0
 def _createTestClient(self):
     testClientConfig = self._config['VistA_Connection']
     system = testClientConfig['system']
     namespace = testClientConfig.get('namespace', DEFAULT_NAMESPACE)
     username = testClientConfig.get('username', None)
     password = testClientConfig.get('password', None)
     prompt = testClientConfig.get('prompt', None)
     return VistATestClientFactory.createVistATestClient(
         system,
         prompt=prompt,
         namespace=namespace,
         instance=self._instance,
         username=username,
         password=password)
Ejemplo n.º 31
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='VistA Routine Export',
                                     parents=[testClientParser])
    parser.add_argument(
        '-o',
        '--outputFile',
        help='Output File Name to store routine export information')
    parser.add_argument('-a',
                        '--allRoutines',
                        action="store_true",
                        default=False,
                        help='export all routines')
    parser.add_argument('-r',
                        '--routines',
                        nargs='*',
                        help='only specified routine names')
    parser.add_argument('-e',
                        '--exclude',
                        nargs='*',
                        default=None,
                        help='exclude specified routine names')
    parser.add_argument(
        '-x',
        '--exception',
        nargs='*',
        default=None,
        help='except specified routine names from the excluded routines')
    result = parser.parse_args()
    print(result)
    outputFilename = result.outputFile
    outputDir = os.path.dirname(outputFilename)
    assert os.path.exists(outputDir)
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME)
        print "Log File is %s" % logFilename
        vistAClient.setLogFile(logFilename)
        isAllRoutines = result.allRoutines
        vistARoutineExport = VistARoutineExport()
        if isAllRoutines:
            vistARoutineExport.exportAllRoutines(vistAClient, outputFilename,
                                                 result.exclude,
                                                 result.exception)
        else:
            vistARoutineExport.exportRoutines(vistAClient, outputFilename,
                                              result.routines, result.exclude,
                                              result.exception)
Ejemplo n.º 32
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Initialize FileMan Utilities',
                                   parents=[testClientParser])
  parser.add_argument('roFile', help="routine import file in ro format")
  result = parser.parse_args();
  print (result)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile()
    print "Log File is %s" % logFilename
    initConsoleLogging()
    vistAClient.setLogFile(logFilename)
    installFileMan22_2(vistAClient, result.roFile)
Ejemplo n.º 33
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Initialize FileMan Utilities',
                                   parents=[testClientParser])
  parser.add_argument('roFile', help="routine import file in ro format")
  result = parser.parse_args();
  print (result)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile()
    print "Log File is %s" % logFilename
    initConsoleLogging()
    vistAClient.setLogFile(logFilename)
    installFileMan22_2(vistAClient, result.roFile)
Ejemplo n.º 34
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="Default KIDS Installer", parents=[testClientParser])
    parser.add_argument("kidsFile", help="path to KIDS Build file")
    parser.add_argument("-l", "--logFile", default=None, help="path to logFile")
    parser.add_argument(
        "-r",
        "--reinstall",
        default=False,
        action="store_true",
        help="whether re-install the KIDS even it is already installed",
    )
    parser.add_argument(
        "-t", "--tglobalprint", default=None, help="folder to hold a printout of Transport global information"
    )
    parser.add_argument("-g", "--globalFiles", default=None, nargs="*", help="list of global files that need to import")
    parser.add_argument("-d", "--duz", default=DEFAULT_INSTALL_DUZ, type=int, help="installer's VistA instance's DUZ")

    result = parser.parse_args()
    print(result)
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    initConsoleLogging()
    with testClient:
        kidsFile = os.path.abspath(result.kidsFile)
        from KIDSBuildParser import KIDSBuildParser

        kidsParser = KIDSBuildParser(None)
        kidsParser.unregisterSectionHandler(KIDSBuildParser.ROUTINE_SECTION)
        kidsParser.parseKIDSBuild(kidsFile)
        installNameList = kidsParser.installNameList
        installName = installNameList[0]
        multiBuildList = installNameList
        if len(installNameList) == 1:
            multiBuildList = None
        defaultKidsInstall = DefaultKIDSBuildInstaller(
            kidsFile,
            installName,
            logFile=result.logFile,
            multiBuildList=multiBuildList,
            duz=result.duz,
            globals=result.globalFiles,
            printTG=result.tglobalprint,
        )
        defaultKidsInstall.runInstallation(testClient, result.reinstall)
Ejemplo n.º 35
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="FOIA Patch Sequence Analyzer", parents=[testClientParser])
    parser.add_argument(
        "-p", "--patchFileDir", required=True, help="input file path to the folder that contains all the FOIA patches"
    )
    parser.add_argument("-l", "--logDir", required=True, help="Output dirctory to store all log file information")
    parser.add_argument(
        "-i", "--install", default=False, action="store_true", help="whether to install KIDS Patch or not"
    )
    group = parser.add_mutually_exclusive_group()
    group.add_argument(
        "-n", "--numOfPatch", default=1, help="input All for all patches, " "otherwise just enter number, default is 1"
    )
    group.add_argument("-u", "--upToPatch", help="install patches up to specified install name")
    group.add_argument(
        "-o",
        "--onlyPatch",
        help="install specified patch and required patches only" ", this option will ignore the CSV dependencies",
    )

    result = parser.parse_args()
    print(result)
    inputPatchDir = result.patchFileDir
    assert os.path.exists(inputPatchDir)
    outputDir = result.logDir
    assert os.path.exists(outputDir)
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        kidsPatchApply = KIDSPatchSequenceApply(vistAClient, outputDir)
        if result.upToPatch:
            kidsPatchApply.generateKIDSPatchSequence(inputPatchDir, result.upToPatch, True)
        else:
            kidsPatchApply.generateKIDSPatchSequence(inputPatchDir, result.onlyPatch)
        if result.install:
            if result.onlyPatch:
                kidsPatchApply.applyKIDSPatchSequenceByNumber("All")
            elif result.upToPatch:
                kidsPatchApply.applyKIDSPatchSequenceByInstallName(result.upToPatch)
            else:
                kidsPatchApply.applyKIDSPatchSequenceByNumber(result.numOfPatch)
Ejemplo n.º 36
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Global Export',
                                   parents=[testClientParser])
  parser.add_argument('-o', '--outputDir', required=True,
                      help='output Dir to store global export file in zwr format')
  result = parser.parse_args();
  print (result)
  outputDir = result.outputDir
  assert os.path.exists(outputDir)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile()
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    vistAGlobalExport = VistAGlobalExport()
    vistAGlobalExport.exportAllGlobals(vistAClient, outputDir)
Ejemplo n.º 37
0
def testMain():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Global Import Tool',
                                   parents=[testClientParser])
  parser.add_argument('-i', '--inputFile', required=True,
                      help='input global file path to be imported to VistA')
  result = parser.parse_args();
  print (result)
  inputFile = result.inputFile
  assert os.path.exists(inputFile)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile()
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    vistAGlobalImport = VistAGlobalImport()
    vistAGlobalImport.importGlobal(vistAClient, inputFile)
Ejemplo n.º 38
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description="VistA M Component Extractor", parents=[testClientParser])
    parser.add_argument("-o", "--outputDir", required=True, help="output Dir to store global/routine export files")
    parser.add_argument("-r", "--vistARepo", required=True, help="path to the top directory of VistA-M repository")
    parser.add_argument("-l", "--logDir", required=True, help="path to the top directory to store the log files")
    parser.add_argument(
        "-ro", "--routineOutDir", default=None, help="path to the directory where GT. M stores routines"
    )
    result = parser.parse_args()
    print(result)
    outputDir = result.outputDir
    assert os.path.exists(outputDir)
    initConsoleLogging()
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        vistADataExtractor = VistADataExtractor(result.vistARepo, outputDir, result.logDir, result.routineOutDir)
        vistADataExtractor.extractData(testClient)
Ejemplo n.º 39
0
def main():
  # Import Argparse and add Scripts/ directory to sys.path
  # by finding directory of current script and going up two levels
  import argparse
  curDir = os.path.dirname(os.path.abspath(__file__))
  scriptDir = os.path.normpath(os.path.join(curDir, "../../"))
  if scriptDir not in sys.path:
    sys.path.append(scriptDir)

  # OSEHRA Imports
  from RPCBrokerCheck import CheckRPCListener
  from VistATestClient import createTestClientArgParser,VistATestClientFactory

  # Arg Parser to get address and port of RPC Listener along with a log file
  # Inherits the connection arguments of the testClientParser

  testClientParser = createTestClientArgParser()
  ssepTestParser= argparse.ArgumentParser(description='Test the M2M broker via XML files',
                                           parents=[testClientParser])
  ssepTestParser.add_argument("-ha",required=True,dest='host',
                              help='Address of the host where RPC Broker is listening')
  ssepTestParser.add_argument("-hp",required=True,dest='port',
                              help='Port of the host machine where RPC Broker is listening')
  ssepTestParser.add_argument("-l",required=True,dest='log_file',
                              help='Path to a file to log the output.')

  # A global variable so that each test is able to use the port and address of the host
  global results
  results = ssepTestParser.parse_args()
  testClient = VistATestClientFactory.createVistATestClientWithArgs(results)
  assert testClient
  with testClient:
    # If checkresult == 0, RPC listener is set up correctly and tests should be run
    # else, don't bother running the tests
    testClient.setLogFile(results.log_file)
    checkresult = CheckRPCListener(testClient.getConnection(),results.host,results.port)
  if checkresult == 0:
    suite = unittest.TestLoader().loadTestsFromTestCase(TestM2MBroker)
    unittest.TextTestRunner(verbosity=2).run(suite)
  else:
    print "FAILED: The RPC listener is not set up as needed."
Ejemplo n.º 40
0
def main():
    testClientParser = createTestClientArgParser()
    parser = argparse.ArgumentParser(description='VistA Global Export',
                                     parents=[testClientParser])
    parser.add_argument(
        '-o',
        '--outputDir',
        required=True,
        help='output Dir to store global export file in zwr format')
    result = parser.parse_args()
    print(result)
    outputDir = result.outputDir
    assert os.path.exists(outputDir)
    """ create the VistATestClient"""
    testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
    assert testClient
    with testClient as vistAClient:
        logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME)
        print "Log File is %s" % logFilename
        vistAClient.setLogFile(logFilename)
        vistAGlobalExport = VistAGlobalExport()
        vistAGlobalExport.exportAllGlobals(vistAClient, outputDir)
Ejemplo n.º 41
0
def testMain():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Global Import Tool',
                                   parents=[testClientParser])
  parser.add_argument('inputGlobalFile',
                      help='input global file path to be imported to VistA')
  parser.add_argument('-t', '--timeout', default=DEFAULT_GLOBAL_IMPORT_TIMEOUT,
                      type=int,
                      help=('global import time out in second, default is %s' %
                             DEFAULT_GLOBAL_IMPORT_TIMEOUT) )
  result = parser.parse_args();
  print (result)
  inputFile = result.inputGlobalFile
  assert os.path.exists(inputFile)
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile()
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    vistAGlobalImport = VistAGlobalImport()
    vistAGlobalImport.importGlobal(vistAClient, inputFile, timeout=result.timeout)
Ejemplo n.º 42
0
def main():
  import logging
  initConsoleLogging(logging.INFO)
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Taskman Utilities',
                                   parents=[testClientParser])
  parser.add_argument('-a', '--action', required=True,
                      choices=['Start', 'Stop', 'Shutdown'],
    help='Start:Start Taskman, Stop:Stop Taskman, Shutdown:Shutdown all tasks')
  result = parser.parse_args();
  print result
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME)
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    taskmanUtil = VistATaskmanUtil()
    actionMap = {"Start": taskmanUtil.startTaskman,
                 "Stop": taskmanUtil.stopTaskman,
                 "Shutdown": taskmanUtil.shutdownAllTasks}
    actionMap[result.action](vistAClient)
Ejemplo n.º 43
0
def main():
  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='VistA Routine Import',
                                   parents=[testClientParser])
  parser.add_argument('routineImportFile',
                      help='path to Routine Import File in .ro format')
  parser.add_argument('-o', '--routineOutputDir', default=None,
                      help='path to Routine output Dir, GTM only')
  result = parser.parse_args();
  print (result)
  routineImportFile = result.routineImportFile
  assert os.path.exists(routineImportFile)
  routineOutputDir = result.routineOutputDir
  """ create the VistATestClient"""
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  assert testClient
  with testClient as vistAClient:
    logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME)
    print "Log File is %s" % logFilename
    vistAClient.setLogFile(logFilename)
    vistARoutineImport = VistARoutineImport()
    vistARoutineImport.importRoutines(vistAClient, routineImportFile,
                                      routineOutputDir)
Ejemplo n.º 44
0
def testMountDisMountLocalDb():
  from VistATestClient import createTestClientArgParser
  from VistATestClient import VistATestClientFactory

  testClientParser = createTestClientArgParser()
  parser = argparse.ArgumentParser(description='InterSystem Cache Mount Dismount Test',
                                   parents=[testClientParser])
  parser.add_argument('-p', '--dirPath', required=True,
                      help='Enter directory path for the local database')
  parser.add_argument('-a', '--action', choices=['M','D'],
                      required=True, type=str,
                      help='M: mount the database, D: dismount the database. '
                           'Make sure InterSystem ^DATABASE routine is accessable via'
                           ' specified namespace.')
  result = parser.parse_args();
  print result
  testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
  with testClient:
    if result.action == 'D':
      logging.info('Dismount LocalDB: %s' % result.dirPath)
      dismountLocalDatabase(result.dirPath, testClient)
    else:
      logging.info('mount LocalDB: %s' % result.dirPath)
      mountLocalDatabase(result.dirPath, testClient)
Ejemplo n.º 45
0
parser.add_argument('-kb',
                    required=True,
                    dest='KIDSbuild',
                    help='Path to the .KIDS file')
parser.add_argument('-o',
                    required=True,
                    dest='outputDir',
                    help='Path to folder to store output files')
#parser.add_argument('-find', required=False, dest='Ffile',
#                    help='Filepath to the Output file of the RFind function.')
#parser.add_argument('-check', required=False, dest='Cfile',
#                    help='Filepath to the Output file of the RCheck function.')
result = parser.parse_args()

# Create a test client and run the KIDSBuildParser on the supplied KIDS build
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
with testClient:
    KIDSParser = KIDSBuildParser(result.outputDir)
    KIDSParser.parseKIDSBuild(result.KIDSbuild)
    KIDSParser.printResult()
    for root, dirnames, filenames in os.walk(result.outputDir):
        for filename in fnmatch.filter(filenames, '*.m'):
            name, ext = filename.split('.')
            routineset.append(name)
    print "Writing out intial XINDEX information: Start"
    FullXINDEX(testClient, result.outputDir, routineset)
    print "Writing out intial XINDEX information: Done"
    resultsfolder = os.path.join(result.outputDir, "RCheck_RFind")
    try:
        os.mkdir(resultsfolder)
Ejemplo n.º 46
0
 def createTestClient(self):
     from __main__ import args
     return VistATestClientFactory.createVistATestClientWithArgs(args)
Ejemplo n.º 47
0
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='Processor for OTJ Evidence with a .KID submission',
                                 parents=[testClientParser])
parser.add_argument('-kb', required=True, dest='KIDSbuild',
                    help='Path to the .KIDS file')
parser.add_argument('-o', required=True, dest='outputDir',
                    help='Path to folder to store output files')
#parser.add_argument('-find', required=False, dest='Ffile',
#                    help='Filepath to the Output file of the RFind function.')
#parser.add_argument('-check', required=False, dest='Cfile',
#                    help='Filepath to the Output file of the RCheck function.')
result = parser.parse_args()

# Create a test client and run the KIDSBuildParser on the supplied KIDS build
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
with testClient:
  KIDSParser = KIDSBuildParser(result.outputDir)
  KIDSParser.parseKIDSBuild(result.KIDSbuild)
  KIDSParser.printResult()
  for root,dirnames,filenames in os.walk(result.outputDir):
    for filename in fnmatch.filter(filenames,'*.m'):
      name,ext = filename.split('.')
      routineset.append(name)
  print "Writing out intial XINDEX information: Start"
  FullXINDEX(testClient,result.outputDir,routineset)
  print "Writing out intial XINDEX information: Done"
  resultsfolder = os.path.join(result.outputDir,"RCheck_RFind")
  try:
    os.mkdir(resultsfolder)