def ispf():
    em = Emulator(hostname, model=2, oversize=(62, 160))
    ispf = ISPF(em, username=username, password=password)
    sdsf = ispf.start('s.log')
    d = sdsf.emulator.display()
    yield d
    ispf.logoff()
def classic_in_out(request):
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    try:
        d = em.display

        welcome = d.find('===> Ex.: LOGON <userid>, TSO <userid>')
        if welcome:
            logger.info(f"Logging to Classic applid {applid}")
            welcome.shift((1, 0))(f"L {applid} DATA='LROWS=9999'", keys.ENTER,
                                  240)

        d(user, keys.NEWLINE)
        d(password, keys.ENTER)

        assert d.find('ZMENU    VTM     OM/DEX')
        yield d
        d(key=keys.PF3)
        d('X', key=keys.ENTER)
    finally:
        em.disconnect()
        em.close()
def classic_in_out(request):
    user = username
    if hasattr(request, 'param'):    
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    d = em.display
    try:
        welcome = d.find('===> Ex.: LOGON <userid>, TSO <userid>')
        if welcome:
            logger.info(f"Logging to Classic applid {applid}")
            welcome.shift((1, 0))(f"L {applid}", keys.ENTER, 240)
            # welcome.shift((1, 0))(f"L {applid} DATA='cics={cics_job},LROWS=9999'", keys.ENTER, 30)
        #welcome(key=Keys.ENTER, wait_for="Please press ENTER to begin")

        d.find('ENTER USERID')
        d(user, keys.NEWLINE)
        d(password, keys.ENTER)

        assert d.find('ZMENU    VTM     OI-II')
        yield d
        d(key=keys.PF3)
        d('X', key=keys.ENTER)
    finally:
        em.disconnect()
        em.close()
def test_ispf_logon(rte_setup):
    """
    After https://jira.rocketsoftware.com/browse/OMBS-936
    we get TSO mode, actually
    :return:
    """
    rte = rte_setup
    em = Emulator(rtes[rte]['hostname'], model=2, oversize=(24, 80))
    ispf = ISPF(em, username=username, password=password)
    d = ispf.em.display
    d(key=keys.PF3)
    assert d.find('READY')
    d(text="ALTLIB ACTIVATE APPL(CLIST) DA('ITM.ITE.QA.CLIST')",
      key=keys.ENTER)
    d('KOMSPFSI', key=keys.ENTER)
    assert d.find('KOMSPFSI\n READY')
    d('ispf', key=keys.ENTER)
    assert d.find('ISPF Primary Option Menu')
    d('6', key=keys.ENTER)
    d(text="ALTLIB ACTIVATE APPL(CLIST) DA('ITM.ITE.QA.CLIST')",
      key=keys.ENTER)
    d('TSO KOMSPFSX', key=keys.ENTER)
    assert d.find('Please press ENTER to begin')
    d(key=keys.ENTER)
    assert d.find('ZMENU    TSO     OM/DEX')
    d(key=keys.PF3)
    d('X', key=keys.ENTER)
    ispf.logoff()
def tso_in_out(request):
    copy_clist('tso')
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    ispf = ISPF(em, username=user, password=password)
    try:
        d = ispf.em.display
        d(key=keys.PF3)
        d(text=f"ALTLIB ACTIVATE APPL(CLIST) DA('{rtes[rte]['clist']}')",
          key=keys.ENTER)
        d(text='%KOI', key=keys.ENTER)
        assert d.find('LOGGING ONTO OMEGAMON/IMS VTAM APPLICATION UNDER TSO')
        d(key=keys.ENTER)

        d(user, keys.NEWLINE)
        d(password, keys.ENTER)

        assert d.find('ZMENU    VTT     OI-II')
        yield d
        d(key=keys.PF3)
        d('X', key=keys.ENTER)
        d('ispf', key=keys.ENTER)
    finally:
        ispf.logoff()
示例#6
0
def classic_in_out_func(username,
                        password,
                        hostname,
                        applid,
                        ssid,
                        security=True):
    em = Emulator(hostname, model=2, oversize=(24, 80))
    d = em.display

    try:
        welcome = d.find('===> Ex.: LOGON <userid>, TSO <userid>')
        if welcome:
            welcome.shift((1, 0))(f"L {applid} DATA='LROWS=9999,DB2={ssid}'",
                                  keys.ENTER, 240)
        if security:
            d(username, keys.NEWLINE)
            d(password, keys.ENTER)
        else:
            d(key=keys.ENTER, timeout=30)

        assert d.find('ZMENU    VTM')
        yield d
        d(key=keys.PF3)
        d('X', key=keys.ENTER)
    finally:
        em.disconnect()
        em.close()
示例#7
0
def ispf_in_out(request):
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    ispf = ISPF(em, username=user, password=password)
    d = ispf.em.display
    d('6', key=keys.ENTER)
    d(text=f"ALTLIB ACTIVATE APPL(CLIST) DA('{rtes[rte]['clist']}')",
      key=keys.ENTER)
    d('%KOCLIST', key=keys.ENTER)
    assert d.find('OCALIST - INVOCATION MENU')

    appl = d.find_by_label('OBVTAM APPL ===>')
    appl(text=applid, key=keys.NEWLINE)
    d(cics_job)
    option = d.find_by_label('OPTION  ===>')
    option('2', key=keys.ENTER)

    d(user, keys.NEWLINE)
    d(password, keys.ENTER)

    assert d.find('ZMENU    VTS')
    yield d
    d(key=keys.PF3)
    d('X', key=keys.ENTER)
    d('X', key=keys.ENTER)
    ispf.logoff()
def test_no_informational_message_during_start(rte):
    # parm-487
    em = Emulator(hostname, model=2, oversize=(24, 80))
    ispf = ISPF(em, username=username, password=password)
    tkancus = f"{rtes[rte]['hlq']}.TKANCUS".upper()
    try:
        d = ispf.em.display
        d('3.4').enter()
        d.find_by_label('Dsname Level . . .')('', keys.ERASEEOF)(tkancus).enter()
        d.find(f'        {tkancus}')('ex').enter()
        assert not d.find('For informational purposes only')
        assert d.find('KCIPQPGW')
    finally:
        ispf.logoff()
示例#9
0
def logon_beacon(host: str,
                 applid: str,
                 username: str,
                 password: str,
                 oversize: Tuple[int, int] = (62, 160)):
    emulator = Emulator(host, model=2, oversize=oversize)
    welcome = emulator.display.find('===> Ex.: LOGON <userid>, TSO <userid>')
    if welcome:
        logger.info(f"Logging to E3270UI applid {applid}")
        welcome.shift((1, 0))(f'L {applid}', keys.ENTER, 30)
    emulator.display(username, keys.TAB, 10)
    emulator.display(password, keys.ENTER, 100)
    if emulator.display.find("OMEGAMON e3270UI What's New"):
        emulator.display(key=keys.PF3)
    return emulator
示例#10
0
    def logon(self):
        if self.ispf is None:
            emulator = Emulator(self.exec_host, model=2, oversize=(62, 160))
            try:
                self.ispf = ISPF(emulator=emulator,
                                 target=self.exec_host,
                                 model=2,
                                 username=self.username,
                                 password=self.password)
                display = self.ispf.em.display
            except:
                emulator.close()
                raise ParmException('LOGON problem')
            display.wait(10, 'ISPF Primary Option Menu')
            display.find_by_label('===>')('3.4').enter()
            gbl_hlq = ''
            try:
                gbl_hlq = rtes[self.rte.lower()]['gbl_hlq']
            except:
                gbl_hlq = self.hlq
            tkancus = f'{gbl_hlq}.TKANCUS'.upper()
            display.find_by_label('Dsname Level . . .')(
                '', keys.ERASEEOF)(tkancus).enter()
            display.find(f'        {tkancus}')('ex').enter()
            display.find_by_label('===>')('3').enter()
            if display.find('KCIP@TLV'):
                display.find_by_label('GBL_TARGET_HILEV:')(
                    '', keys.ERASEEOF)(gbl_hlq).enter()
            # there are 2 3270 fields for GBL_USER_JCL (no idea why), so find_by_label doesn't work
            display.find('GBL_USER_JCL:')('')
            display.cursor = display.cursor[0], display.cursor[1] + 16
            display('', keys.ERASEEOF)(f'{self.hlq}.PARMGEN.JCL')
            display.find_by_label('RTE_PLIB_HILEV:')('',
                                                     keys.ERASEEOF)(self.hlq)
            display.find_by_label('RTE_NAME:')('', keys.ERASEEOF)(
                self.rte).enter()

            if self.is_new:
                # if not display.find('You have asked to configure a new RTE profile.'):
                #   raise ParmException('Incorrect panel')
                display('').enter()
            if not display.find('KCIPQPGB'):
                raise ParmException('Incorrect panel')
            else:
                self.d = display
def tso_in_out(request, rte_setup):
    rte = rte_setup
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(rtes[rte]['hostname'], model=2, oversize=(24, 80))
    ispf = ISPF(em, username=user, password=password)
    d = ispf.em.display
    d(key=keys.PF3)
    d(text=f"ex '{rtes[rte]['rte_hlq']}.RKANSAMU(KOMCLSTE)'", key=keys.ENTER)
    assert d.find('Please press ENTER to begin')
    d(key=keys.ENTER)
    assert d.find('ZMENU    TSO     OM/DEX')
    yield d
    d(key=keys.PF3)
    d('X', key=keys.ENTER)
    d('ispf', key=keys.ENTER)
    ispf.logoff()
def classic_in_out(request):
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    d = em.display
    try:
        welcome = d.find('===> Ex.: LOGON <userid>, TSO <userid>')
        if welcome:
            welcome.shift((1, 0))(f"L {applid} DATA='LROWS=9999,DB2={ssid}'",
                                  keys.ENTER, 240)
        d(user, keys.NEWLINE)
        d(password, keys.ENTER)

        yield d
    finally:
        em.disconnect()
        em.close()
def test_ispf_logon_with_komspf_is_disabled(rte_setup):
    """
    After https://jira.rocketsoftware.com/browse/OMBS-936
    full ISPF is disabled
    :return:
    """
    rte = rte_setup
    em = Emulator(rtes[rte]['hostname'], model=2, oversize=(24, 80))
    ispf = ISPF(em, username=username, password=password)
    d = ispf.em.display
    d('6', key=keys.ENTER)
    d(text="ALTLIB ACTIVATE APPL(CLIST) DA('ITM.ITE.QA.CLIST')",
      key=keys.ENTER)
    d('komspf', key=keys.ENTER)
    d('3', key=keys.ENTER)
    if d.find('KOMSPF - KEY ASSIGNMENT PANEL'):
        d(key=keys.ENTER)
    assert d.find('OB1230 Full ISPF mode is not supported')
    d(key=keys.ENTER)
    d('x', key=keys.ENTER)
    ispf.logoff()
示例#14
0
def tso_in_out(request):
    user = username
    if hasattr(request, 'param'):
        user = request.param

    em = Emulator(hostname, model=2, oversize=(24, 80))
    ispf = ISPF(em, username=user, password=password)
    d = ispf.em.display
    try:
        d(key=keys.PF3)
        d(text=f"ALTLIB ACTIVATE APPL(CLIST) DA('{rtes[rte]['clist']}')",
          key=keys.ENTER)
        d(text='%KOCLIST', key=keys.ENTER)

        d(user, keys.NEWLINE)
        d(password, keys.ENTER)

        assert d.find('ZMENU    VTT')
        yield d
        d(key=keys.PF3)
        d('X', key=keys.ENTER)
        d('ispf', key=keys.ENTER)
    finally:
        ispf.logoff()
示例#15
0
def test_run_omegamon_z_os_tso_KOMCLSTE_without_abend():
    '''
    https://jira.rocketsoftware.com/browse/OMBS-1457

    Omegamon z/OS TSO KOMCLSTE does not have abend S0C4-04 KOBAS510 after running.
    It is reproduced only on ite4.
    '''
    em = Emulator('rsd4', model=2, oversize=(24, 80))
    ispf = ISPF(em, username=username, password=password)
    rte = 'ite4'
    try:
        d = ispf.em.display
        d.find_by_label('===>')('=xall').enter()
        d.find('READY')
        abend = 'OB0933 OMEGAMON resource cleanup initiated for abend S0C4  RC=00000004'
        d(f"exec '{rtes[rte]['rte_hlq']}.RKANSAMU(KOMCLSTE)'").enter()
        assert not d.find(abend)
        d('', key=keys.PF3)
        d.find('READY')
        d(f"exec '{rtes[rte]['rte_hlq']}.RKANSAMU(KOMCLIST)'").enter()
        assert not d.find(abend)
    finally:
        ispf.em.disconnect()
        ispf.em.close()
def test_all_products_available_in_jobgen(rte):
    # parm-487
    em = Emulator(hostname, model=2, oversize=(62, 160))
    ispf = ISPF(em, username=username, password=password)
    tkancus = f"{rtes[rte]['hlq']}.TKANCUS".upper()
    try:
        d = ispf.em.display
        d('3.4').enter()
        d.find_by_label('Dsname Level . . .')('', keys.ERASEEOF)(tkancus).enter()
        d.find(f'        {tkancus}')('ex').enter()
        assert d.find('KCIPQPGW')
        d('2').enter()
        if d.find('KCIP@TLV'):
            d(rtes[rte]['rte_hlq'][:-5]).enter()
        assert d.find('KCIPJG00')
        d(f'{username}.PARM.TEST.TMP').enter()
        # collect products from first screen
        all_products = str(d)
        # go to the next page
        d('', keys.PF8)
        all_products = all_products + str(d)
        assert all((prod in all_products for prod in products.split('\n')))
    finally:
        ispf.logoff()
示例#17
0
def ispf(request):
    em = Emulator(hostname, model=2, oversize=(62, 160))
    ispf = ISPF(em, username=username, password=password)
    yield ispf
    ispf.logoff()