def test_dialog_not_available(self): """ Verify item 'LUNs' of menu 'Create' on Initiator Groups page is disabled when no initiator group selected. """ initiatorGroupPrefix = 'IG' initiatorGroupNumber = 3 initiatorGroups = self._createInitiatorGroups( prefix=initiatorGroupPrefix, number=initiatorGroupNumber) LOG.step('Navigating to Initiator Groups page') HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) self.assertTrue(initiatorGroupsPage.isOpen()) LOG.info('Initiator Groups page is open:', initiatorGroupsPage.isOpen()) LOG.step('Unselecting all initiator groups in grid') initiatorGroupsPage.gridInitiatorGroups.unselect() initiatorGroups = initiatorGroupsPage.gridInitiatorGroups.find( selected=True) self.assertFalse(initiatorGroups) LOG.info('Selected initiator groups:', initiatorGroups) LOG.step("Verifying menu item 'Create -> LUNs' is disabled") menuCreate = initiatorGroupsPage.menuCreate self.assertFalse(menuCreate.isItemEnabled(item='LUNs')) LOG.info("Menu item 'Create -> LUNs' is enabled:", menuCreate.isItemEnabled(item='LUNs'))
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) LOG.info('Destroying existing LUNs...') self.marscluster.lun.unmapAll() self.marscluster.lun.destroyAll() self.assertFalse(self.marscluster.lun.show(json=True)) LOG.info('Done.') LOG.info('Destroying existing initiator groups...') self.marscluster.igroup.destroyAll() LOG.info('Done.') self.luns = express.Luns(node=self.marscluster) LOG.step('Signing in') self.loginPage.open() self.loginPage.waitUntilOpen() if self.locale is None: self.locale = self.loginPage.getRandomLocale() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.info('Signed in with username: %s, password: %s, locale: %s.' % (self.username, self.password, self.locale)) LOG.info('Browser landed on header page.') LOG.info('Navigating to Initiator Groups page...') self.headerPage.btnManager.click() self.allStoragePage.tabInitiatorGroups.click() self.initiatorGroupsPage.waitUntilOpen() LOG.info('Browser landed on Initiator Groups page.')
def testSetup(self): self.driver = self.setupDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) LOG.step('Signing in') self.loginPage.open() self.loginPage.waitUntilOpen() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.info('Signed in with username: %s, password: %s, locale: %s.' % (self.username, self.password, self.locale)) LOG.info('Browser landed on header page.') LOG.step('Navigating to LUNs page') self.headerPage.btnManager.click() self.allStoragePage.tabLUNs.click() self.lunsPage.waitUntilOpen() LOG.info('Browser landed on LUNs page.') LOG.step('Creating LUNs') self.lunNamePrefix = 'LuN' self.lunCount = 20 self.luns.create(count=self.lunCount, size='1g', prefix=self.lunNamePrefix) luns = self.marscluster.lun.show(json=True) LOG.info('LUNs created:\n', [lun['name'] for lun in luns]) self.lunsPage.btnRefresh.click() self.lunsPage.btnRefresh.waitUntilEnabled()
def testSetup(self): self.driver = self.setupDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) self.defineLUNsPage = DefineLUNsPage(driver=self.driver)
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) self.marscluster.snapshot.deleteAll() luns = express.Luns(node=self.marscluster, cleanup=True) del luns self.luns = express.Luns(node=self.marscluster) LOG.step('Signing in') self.loginPage.open() if self.locale is None: self.locale = self.loginPage.getRandomLocale() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.info('Signed in with username: %s, password: %s, locale: %s.' % (self.username, self.password, self.locale)) LOG.info('Browser landed on header page.') LOG.info('Navigating to LUNs page...') self.headerPage.btnManager.click() self.allStoragePage.tabLUNs.click() self.lunsPage.waitUntilOpen() LOG.info('Browser landed on LUNs page.')
def testSetup(self): self.driver = self.getDriver() self.driver.timeout = self.timeout self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) LOG.info('Destroying existing LUNs...') self.marscluster.lun.unmapAll() self.marscluster.lun.destroyAll() self.assertFalse(self.marscluster.lun.show(json=True)) LOG.info('Done.') LOG.info('Destroying existing initiator groups...') self.marscluster.igroup.destroyAll() LOG.info('Done.') LOG.info('Destroying existing consistency groups...') self.deleteDependentConsistencyGroups() LOG.info('Done.') if self.locale is None: self.locale = self.loginPage.getRandomLocale() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale)
def test_dialog_not_available(self): """ Verify menu 'Edit' on Initiator Groups page is disabled when no initiator group selected. """ initiatorGroupPrefix = 'IG' initiatorGroupNumber = 3 self._createInitiatorGroups(prefix=initiatorGroupPrefix, number=initiatorGroupNumber) LOG.step('Navigating to Initiator Groups page') HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() self.assertTrue(self.initiatorGroupsPage.isOpen()) LOG.info('Initiator Groups page is open:', self.initiatorGroupsPage.isOpen()) self.initiatorGroupsPage.btnRefresh.click() self.initiatorGroupsPage.btnRefresh.waitUntilEnabled() LOG.step('Unselecting all initiator groups in grid') self.initiatorGroupsPage.gridInitiatorGroups.unselect() initiatorGroups = self.initiatorGroupsPage.gridInitiatorGroups.find( selected=True) self.assertFalse(initiatorGroups) LOG.info('Selected initiator groups:', initiatorGroups) LOG.step("Verifying menu 'Edit' is disabled") self.assertFalse(self.initiatorGroupsPage.menuEdit.isEnabled()) LOG.info("Menu 'Edit' is enabled:", self.initiatorGroupsPage.menuEdit.isEnabled())
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) self.loginPage.signIn(username=self.username, password=self.password)
def open(self): # Select menu item 'Create -> LUNs' HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() LUNsPage(driver=self.driver).menuCreate.select(item='LUNs') self.defineLUNsPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]]
def open(self, parentConsistencyGroup=None): # Select menu item 'Create -> LUNs' HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabConsistencyGroups.click() consistencyGroupsPage = ConsistencyGroupsPage(driver=self.driver) if parentConsistencyGroup is not None: consistencyGroupsPage.gridConsistencyGroups.unselect() consistencyGroupsPage.gridConsistencyGroups.select(name=parentConsistencyGroup) menuCreate = consistencyGroupsPage.menuCreate menuCreate.select(item='Consistency group') self.createConsistencyGroupPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[self.activePageNumber]]
def open(self): """ Open dialog 'Create an Initiator Group'. """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) initiatorGroupsPage.menuCreate.select(item='Initiator Group') self.createInitiatorGroupPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('%s.open()' % self.name)
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.loginFailedPage = LoginFailedPage(driver=self.driver) LOG.step('Opening login page') self.loginPage.open() if self.locale is None: self.locale = self.loginPage.getRandomLocale() LOG.step('Selecting locale: %s' % self.locale) self.loginPage.selectLocale(locale=self.locale) LOG.info('Selected locale: %s' % self.locale)
def open(self, initiator_group): """ @param initiator_group: Name of initiator group to select in grid. """ # Select menu item 'Create -> LUNs' HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) initiatorGroupsPage.gridInitiatorGroups.select( initiator_group=initiator_group) initiatorGroupsPage.menuCreate.select(item='LUNs') self.defineLUNsPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]]
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) self.lunDetailsPage = LUNDetailsPage(driver=self.driver) self.lunSnapshotsPage = LUNSnapshotsPage(driver=self.driver) LOG.step('Cleaning out cluster content') snapshots = self.marscluster.snapshot.show(json=True) for snapshot in snapshots: self.marscluster.snapshot.delete(name=snapshot['name'], lun=snapshot['object']) self.assertFalse(self.marscluster.snapshot.show(json=True)) LOG.info('Snapshots destroyed.') luns = express.Luns(node=self.marscluster, cleanup=True) del luns self.assertFalse(self.marscluster.lun.show(json=True)) LOG.info('LUNs destroyed.') self.marscluster.igroup.destroyAll() LOG.info('Initiator groups destroyed.') self._deleteDependentConsistencyGroups() LOG.info('Consistency groups destroyed.') self.luns = express.Luns(node=self.marscluster) LOG.step('Signing in') self.loginPage.open() self.loginPage.waitUntilOpen() if self.locale is None: self.locale = self.loginPage.getRandomLocale() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.info('Signed in with username: %s, password: %s, locale: %s.' % (self.username, self.password, self.locale)) LOG.info('Browser landed on header page.') LOG.info('Navigating to LUNs page...') self.headerPage.btnManager.click() self.allStoragePage.tabLUNs.click() self.lunsPage.waitUntilOpen() LOG.info('Browser landed on LUNs page.')
def takeOnline(self, **filterAttrs): """ Selects LUN(s) in grid by names(s), then selects menu item Edit -> state -> Online. @param filterAttrs: Filtering condition applied to rows of grid. See satisfyFilters(). """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() lunsPage = LUNsPage(driver=self.driver) # In LUNs grid, select row with given LUN name by checking row check box. lunsPage.gridLUNs.unselect() lunsPage.gridLUNs.select(**filterAttrs) menuEdit = lunsPage.menuEdit # In menu 'Edit', select item 'Name'. menuEdit.select(item=['State', 'Online']) LOG.l4('EditLUNStateWizard.takeOnline()')
def open(self, initiator_group): """ Open dialog 'Change Initiators'. @param initiator_group: Name of initiator group to select in grid. """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) initiatorGroupsPage.gridInitiatorGroups.select( initiator_group=initiator_group) initiatorGroupsPage.menuEdit.select(item='Initiators') self.changeInitiatorsPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('%s.open()' % self.name)
def open(self, initiator_groups): """ @param initiator_groups: Name or names (as list) of initiator group(s) to select in grid. """ # Select menu item 'Create -> LUNs' HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabInitiatorGroups.click() initiatorGroupsPage = InitiatorGroupsPage(driver=self.driver) initiatorGroupsPage.gridInitiatorGroups.select( initiator_group=initiator_groups) initiatorGroupsPage.menuEdit.select(item='OS Type') self.changeInitiatorGroupOSTypePage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4("ChangeInitiatorGroupOSTypeWizard.open(initiator_groups='%s')" % initiator_groups)
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.consistencyGroupsPage = ConsistencyGroupsPage(driver=self.driver) LOG.step('Cleaning out cluster content') LOG.info('Destroying LUNs...') luns = express.Luns(node=self.marscluster, cleanup=True) del luns self.assertFalse(self.marscluster.lun.show(json=True)) LOG.info('Done.') LOG.info('Deleting consistency groups...') while True: consistencyGroups = self.marscluster.cg.show(json=True) if consistencyGroups: self.marscluster.cg.delete(name=consistencyGroups[0]['name']) else: break self.assertFalse(self.marscluster.cg.show(json=True)) LOG.info('Done.') self.luns = express.Luns(node=self.marscluster) LOG.step('Signing in') self.loginPage.open() self.loginPage.waitUntilOpen() if self.locale is None: self.locale = self.loginPage.getRandomLocale() self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.info('Signed in with username: %s, password: %s, locale: %s.' % (self.username, self.password, self.locale)) LOG.info('Browser landed on header page.') LOG.info('Navigating to Consistency Groups page...') self.headerPage.btnManager.click() self.allStoragePage.tabConsistencyGroups.click() self.consistencyGroupsPage.waitUntilOpen() LOG.info('Browser landed on Consistency Groups page.')
def open(self, name): """ Select LUN in grid by given name, then open 'Edit IDs' dialog. @param name: Name of LUN which to select in grid. """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() lunsPage = LUNsPage(driver=self.driver) # In LUNs grid, select row with given LUN name by checking row check box. lunsPage.gridLUNs.unselect() lunsPage.gridLUNs.select(name=name) # In menu 'Edit', select item 'ID'. lunsPage.menuEdit.select(item='ID') self.editIDsPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('%s.open()' % self.name)
def openTakeOffline(self, **filterAttrs): """ Select LUN(s) in grid by given name(s), then open 'Take LUNs Offline' dialog. @param filterAttrs: Filtering condition applied to rows of grid. See satisfyFilters(). """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() lunsPage = LUNsPage(driver=self.driver) # In LUNs grid, select rows satisfying filter conditions by checking row check box. lunsPage.gridLUNs.unselect() lunsPage.gridLUNs.select(**filterAttrs) menuEdit = lunsPage.menuEdit # In menu 'Edit', select item 'Name'. menuEdit.select(item=['State', 'Offline']) self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('EditLUNStateWizard.openTakeOffline()')
def open(self, name): """ Select LUN(s) in grid by given name(s), then open 'Delete LUNs' dialog. @param name: Name of LUN(s) which to select in grid. 'LUN_Name' if single LUN, list of names when multiple LUNs selected (ex. ['LUN_1', 'LUN_2', 'LUN_3']). """ HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() lunsPage = LUNsPage(driver=self.driver) # In LUNs grid, select row with given LUN name by checking row check box. lunsPage.gridLUNs.unselect() lunsPage.gridLUNs.select(name=name) lunsPage.btnDelete.waitUntilEnabled() lunsPage.btnDelete.click() self.deleteLUNPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('DeleteLUNWizard.open()')
def testSetup(self): self.driver = self.getDriver() self.loginPage = LoginPage(driver=self.driver, url=self.webUIHostName) self.headerPage = HeaderPage(driver=self.driver) self.allStoragePage = AllStoragePage(driver=self.driver) self.lunsPage = LUNsPage(driver=self.driver) self.mars[0].lun.unmapAll() self.mars[0].lun.destroyAll() self.luns = express.Luns(node=self.node, cleanup=True) self.loginPage.signIn(username=self.username, password=self.password, locale=self.locale) LOG.step('Navigating to All Storage -> LUNs page') self.headerPage.btnManager.waitUntilPresent() self.headerPage.btnManager.click() self.allStoragePage.tabLUNs.waitUntilPresent() self.allStoragePage.tabLUNs.click() self.lunsPage.gridLUNs.waitUntilPresent() LOG.info("Grid is present on web page.")
def open(self, name): """ Select LUN in grid by given name, then open dialog. @param name: Name of LUN which to select in grid. """ if isinstance(name, list) and len(name) != 1: raise FailedConfigException( 'Wizard accepts single LUN name as argument.') HeaderPage(driver=self.driver).btnManager.click() AllStoragePage(driver=self.driver).tabLUNs.click() lunsPage = LUNsPage(driver=self.driver) # In LUNs grid, select row with given LUN name by checking row check box. lunsPage.gridLUNs.unselect() lunsPage.gridLUNs.select(name=name) # In menu 'Edit', select item 'Name'. lunsPage.menuEdit.select(item='Mappings') self.editMappingsPage.waitUntilOpen() self.activePageNumber = 0 self.activePage = self._pages[self._pages.keys()[ self.activePageNumber]] LOG.l4('EditLUNMappingsWizard.open()')