def cics_navigate_to_KCPRGNS(d: Display, timeout=30): d(key=keys.HOME) d('n.c', key=keys.ENTER, timeout=timeout) assert u.get_current_panel() == 'KCPSTART' u.zoom_into_first_row('CICSplex\nName', d=d) assert u.get_current_panel() == 'KCPRGNS'
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 test_several_file_menu_options_are_disabled_for_unpriviledged_user( e3270_in_out): d = e3270_in_out d(key=keys.HOME) for option in ['o', 's']: current_panel = e3270u.get_current_panel(d) d('f.' + option).enter() assert current_panel == e3270u.get_current_panel(d)
def test_several_tools_menu_options_are_disabled_for_unpriviledged_user( e3270_in_out): d = e3270_in_out d(key=keys.HOME) for option in ['a', 'u', 'h', 'p', 's', 'd', 'v', 'o']: current_panel = e3270u.get_current_panel(d) d('t.' + option).enter() assert current_panel == e3270u.get_current_panel(d)
def test_panel_session_logon_is_disabled(e3270_in_out): d = e3270_in_out d(key=keys.HOME) d('e.p', key=keys.ENTER, timeout=30) assert e3270u.get_current_panel(d) == 'KOBPRFCL' e3270u.click_tab(' Session/Logon ', d=d) # we must stay on the same panel assert e3270u.get_current_panel(d) == 'KOBPRFCL' assert not e3270u.get_current_panel(d) == 'KOBPRFSS'
def test_prohibit_koblogon_as_the_first_workspace(e3270_special): d = e3270_special d(key=keys.HOME) d('e.p', key=keys.ENTER, timeout=30) assert e3270u.get_current_panel(d) == 'KOBPRFCL' e3270u.click_tab(' Session/Logon ', d=d) assert e3270u.get_current_panel(d) == 'KOBPRFSS' d.find_by_label("First workspace to be displayed . .")('KOBLOGON') d.find("BACK")('').enter() assert d.find('Multi-Tenancy KOBLOGON cannot be your first workspace')
def test_first_workspace_option_is_the_same_as_defined_in_user_profile( e3270_special): user_profile = z.read_ds(dataset=f'{hlq}.UKOBDATF({username})') firstws = re.search(f'FIRSTWS=(\w+)', user_profile).group(1) d = e3270_special d(key=keys.HOME) d('e.p', key=keys.ENTER, timeout=30) assert e3270u.get_current_panel(d) == 'KOBPRFCL' e3270u.click_tab(' Session/Logon ', d=d) assert e3270u.get_current_panel(d) == 'KOBPRFSS' first_ws = d.find_all_by_label("First workspace to be displayed . .")[0] assert firstws == str(first_ws)
def test_verify_tabs_are_shown_according_to_config(panel, e3270_in_out): d = e3270_in_out d(key=keys.HOME) counter = 0 for option in ['e', 'z', 'c', 'g', 'i', 'd', 'm', 'n', 's', 'j']: current_panel = e3270u.get_current_panel(d) d('n.' + option).enter() if panel[counter] == 'Y': assert current_panel != e3270u.get_current_panel(d) elif panel[counter] == 'N': assert current_panel == e3270u.get_current_panel(d) counter += 1
def test_tennant_users_with_no_access_to_zos_are_able_to_view_memory_display(): data = z.read_ds(f'{hlq}.UKOBDATF(KOBGROUP)') start = data.find('TDB2') if data.find('SHOWZOS=Y', start): data = data.replace('SHOWZOS=Y', 'SHOWZOS=N') z.write_ds(f'{hlq}.UKOBDATF(KOBGROUP)', data) em = e3270u.logon_beacon(hostname, applid, username, password) try: d = em.display d(key=keys.HOME) d('n.z').enter() assert e3270u.get_current_panel(d) == 'KOBSEVTS' d(key=keys.HOME) d('v.m').enter() assert e3270u.get_current_panel(d) == 'KOBSEVTS' finally: e3270u.close_beacon(em)
def create_sit(d, sit_name, om, table, column, distribution, value): d(key=keys.HOME) d('e.s', key=keys.ENTER) u.zoom_in(om, '') assert d.find('Create New Situation') # should be fast enough d(sit_name, key=keys.ENTER, timeout=5) assert d.find('KOBSEDPD') while not d.find(table): d.find('Table Name')('', key=keys.PF8) u.zoom_in(table, 'S') while not d.find(column): d.find('Column Name')('', key=keys.PF8) u.zoom_in(column, 'S') assert d.find(regex=f' {column} .* Yes ') u.click_tab(' Accept ') assert d.find('KOBSEDTF') u.zoom_in('Interval', 'S') assert d.find('KOBSEDEF') u.tab() # set 30 seconds d('00') u.tab() d('00') u.tab() d('30').enter() u.zoom_in('*IF *VALUE', 'S') assert d.find('KOBSEDPA') u.zoom_in('VALUE == 0', 'S') assert d.find('Options Menu') d('1').enter() d.find(table.replace(' ', '_')).shift((1, 2))(f'{value}').enter() u.click_tab(' Accept ') u.click_tab(' Accept ') assert u.get_current_panel() == 'KOBSEDTF' u.click_tab(' Distribution ') assert u.get_current_panel() == 'KOBSEDTD' u.zoom_in(distribution, 'S') # check that system has been added assert d.find(regex='Systems .*Overrides').shift( (2, 0)).find(distribution) u.click_tab(' Formula ') assert u.get_current_panel() == 'KOBSEDTF' u.click_tab(' OK ') return True
def test_verify_push_buttons_works_fine(e3270_special): d = e3270_special d(key=keys.HOME) d('n.d').enter() assert e3270u.get_current_panel(d) == 'KDPSTART' d.cursor = e3270u.get_cursor_on_first_row_in_column('DB2\nID', d=d) d('R').enter() d.find('OK')('').enter() d.enter() assert d.find('Fastpath navigation is prohibited') is None
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 test_verify_situation_search(e3270_in_out): """ Test to verify if situation search is working. """ d = e3270_in_out d(key=keys.HOME) sit_name = 'IMS_Inactive' d('e.s', key=keys.ENTER) assert u.get_current_panel(d) == 'KOBSED1' d.find_by_label('Find:')(f'{sit_name}').enter() d.find('+ IMS')('').enter() assert d.find(f'IMS\n {sit_name}\nJava Virtual Machines')
def test_check_do_not_show_the_first_sub_panel_and_jvm_tree(): text_from_kobuser = z.read_ds(f'{hlq}.UKOBDATF(KOBUSER)') group_user = re.search(f'USERID:{username.upper()}\s+GROUP:(\w+)', text_from_kobuser).group(1) text_from_kobgroup = z.read_ds(f'{hlq}.UKOBDATF(KOBGROUP)') group_pos = re.search(group_user, text_from_kobgroup).end() if text_from_kobgroup.find('SHOWJAVA=Y', group_pos): text_changed = text_from_kobgroup.replace('SHOWJAVA=Y', 'SHOWJAVA=N') z.write_ds(f'{hlq}.UKOBDATF(KOBGROUP)', text_changed) em = e3270u.logon_beacon(hostname, applid, username, password) try: d = em.display d(key=keys.HOME) d('=KOBSEVTS').enter() assert e3270u.get_current_panel(d) == 'KOBSEVTS' assert not d.find(regex=r'Tree\sname\s\S+\s+Options') current_panel = e3270u.get_current_panel(d) d('n.j').enter() assert current_panel == e3270u.get_current_panel(d) finally: z.write_ds(f'{hlq}.UKOBDATF(KOBGROUP)', text_from_kobgroup) e3270u.close_beacon(em)
def test_kobgroup_firstws_working_for_superuser(zosmf): """ https://jira.rocketsoftware.com/browse/OMBS-1407 Setting up user TS5813A as SUPER and changing group to OMEGCICS in KOBUSER member. Checking if FIRSTWS KOBSCICS specified in KOBGROUP for OMEGCICS will be picked up by superuser logon. Reverting changes made in KOBUSER member. """ rte_hlq = rtes[rte]['rte_hlq'] input_file = f"{rte_hlq}.UKOBDATF(KOBUSER)" file_backup = zosmf.read_ds(input_file) try: required_setup = f'{username.upper()} GROUP:OMEGCICS SUPER:YES' text_to_change = re.sub( rf"{username.upper()}\s+GROUP:(\w+)\s+SUPER:\w+", required_setup, file_backup) zosmf.write_ds(input_file, text_to_change) em = e3270u.logon_beacon(hostname, applid, username, password) d = em.display d(key=keys.HOME) assert e3270u.get_current_panel(d) == 'KOBSCICS' finally: e3270u.close_beacon(em) zosmf.write_ds(input_file, file_backup)
def test_disable_first_workspace(e3270_in_out): d = e3270_in_out d(key=keys.HOME) d('e.w').enter() assert e3270u.get_current_panel(d) != 'KOBWIZ01'
def test_disable_save_as_pulldown(e3270_in_out): d = e3270_in_out current_panel = e3270u.get_current_panel(d) d(key=keys.HOME) d('f.a').enter() assert e3270u.get_current_panel(d) == current_panel