def test_not_defined_user_can_only_logoff(): util.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, 'notdefined_user', 'multi', ()) ds = z.read_ds(f'{hlq}.UKOBDATF({username[:-1].upper()}B)') z.del_ds(f'{hlq}.UKOBDATF({username[:-1].upper()}B)') time.sleep(30) em = e3270u.logon_beacon(hostname, applid, username=username[:-1] + 'b', password=password) try: d = em.display d(key=keys.HOME) for option in ['e', 'z', 'c', 'g', 'i', 'd', 'm', 'n', 's']: current_panel = e3270u.get_current_panel(d) d('n.' + option).enter() if option == 'e': d('n.h').enter() d('n.h').enter() assert d.find('Multi-Tenancy Definition Error') else: assert current_panel == e3270u.get_current_panel(d) finally: e3270u.close_beacon(em) zftp = ZFTP(hostname, username, password) zftp.upload_ds(text=ds, dest=f'{hlq}.UKOBDATF({username[:-1].upper()}B)')
def choose_multi(parameter): data = z.read_ds(f'ROCKET.USER.PROCLIB({rtes[rte]["tom_stc"]})') data = re.sub(r'/\/\[*]?(\s+)\'MULTI=[N,Y]\',', f"// 'MULTI={parameter}',", data) z.write_ds(f'ROCKET.USER.PROCLIB({rtes[rte]["tom_stc"]})', data) util.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, 'dataset', 'multi', (), rtes[rte]['tom_stc'], 120)
def rte_setup(request): rte = request.param omegamon = 'zos' hostname = rtes[rte]['hostname'] # for these tests, we don't need stc, but we need to start it just to make sure libs are APF authorized utils.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, omegamon, 'basic', ('KOMSUPD', 'KOMRACFA'), f'{rte}M2RC') # prepare ispf logon # we need to copy KOMSPF and KOMSPFU, # KOMSPFSC, KOMSPFSI, KOMSPFSX for new ispf logon from *.RKANSAMU to to ROCKET.USER.CLIST z = zOSMFConnector(hostname, username, password) for mem in ('KOMSPF', 'KOMSPFU', 'KOMSPFSC', 'KOMSPFSI', 'KOMSPFSX'): read_mem = z.read_ds(f"{rtes[rte]['rte_hlq']}.RKANSAMU({mem})") z.write_ds(f'ITM.ITE.QA.CLIST({mem})', read_mem) return rte
def test_non_super_user_has_not_access_to_all_db2_ssids_at_both_levels(): util.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, 'nonsuperuser', 'multi', ()) em = e3270u.logon_beacon(hostname, applid, username=username[:-1], password=password) try: d = em.display() assert d.find('No Client Defined') d(key=keys.HOME) d('n.d').enter() assert 'Rows:00' finally: e3270u.close_beacon(em) util.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, 'dataset', 'multi', ())
def test_no_whats_new_for_new_user(): util.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, 'notdefined_user', 'multi', ()) ds = z.read_ds(f'{hlq}.UKOBDATF({username[:-1].upper()}B)') z.del_ds(f'{hlq}.UKOBDATF({username[:-1].upper()}B)') time.sleep(30) em = e3270u.logon_beacon(hostname, applid, username=username[:-1] + 'b', password=password) try: d = em.display assert e3270u.get_current_panel(d) != "KOBSSNEW" d(key=keys.HOME) d('h.w').enter() assert e3270u.get_current_panel(d) == "KOBHLDIR" finally: e3270u.close_beacon(em) zftp = ZFTP(hostname, username, password) zftp.upload_ds(text=ds, dest=f'{hlq}.UKOBDATF({username[:-1].upper()}B)')
def setup_module(module): utils.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, omegamon, 'basic', ('KOCSUPD', 'KOCRACFA'), stc_job)
def setup_module(module): utils.set_security(hostname, username, password, rtes[rte]['rte_hlq'], rte, omegamon, 'passphrase-external', ('KO2SUPD', 'KO2RACFA'), stc_job, 120)