Ejemplo n.º 1
0
Archivo: run.py Proyecto: venky74/steam
def readRolesTest():
    try:
        role = tu.createRole("hello", "hey", [1, 2, 4, 5, 6, 9, 10, 17, 18])
        inds = [8, 19, 21, 4, 15, 0, 11, 6, 17]
        iden = tu.createIdentity("billy", "bob")
        tu.assignRole(iden, role)
    except:
        print "Failed to set up read roles test"
        return False
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    try:
        tu.goUsers(d)
        tu.goRoles(d)
        time.sleep(2)
        wait.until(lambda x: len(
            x.find_elements_by_xpath("//input[@type='checkbox']")) > 22)
        checked = d.find_elements_by_xpath(
            "//input[@type='checkbox' and @value='on']")
        boxes = d.find_elements_by_xpath("//input[@type='checkbox']")
        for i in inds:
            box = d.find_elements_by_xpath("//input[@type='checkbox']")[(i * 2)
                                                                        + 1]
            if not box in checked:
                print "Permission {0} isn't checked".format(i)
                return False
    except Exception as e:
        print e
        print "Failed to access users/roles page"
        return False
    finally:
        tu.endtest(d)

    return True
Ejemplo n.º 2
0
def main():
	s = Server('/home/creature/browsermob/bin/browsermob-proxy', { 'port' : 1337})
	s.start()
	proxy = s.create_proxy({'port': 1338})
	failcount = 0
	d = tu.newProxytest(proxy)
	proxy.new_har(options={'captureHeaders':False, 'captureContent': True})
	if not deployOneTest(d):
		failcount += 1
	if not deleteTest(d):
		failcount += 1
	if not projectDeployTest(d):
		failcount += 1
		out = open('deploy.har', 'w')
		out.write(str(proxy.har))
		out.close()
	# test all services from multiple projects showing up in services
	if not multiDeployTest(d):
		failcount += 1
	# test that stopping services from services page removes them from project deployments
	if not cleanupTest(d):
		failcount += 1

	tu.endtest(d)
	s.stop()
	sys.exit(failcount)
Ejemplo n.º 3
0
Archivo: run.py Proyecto: venky74/steam
def main():
    failcount = 0
    d = tu.newtest()

    if not nameFilterTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Ejemplo n.º 4
0
def main():
    failcount = 0
    d = tu.newtest()

    if not compRegTest(d):
        failcount += 1
    if not compBinTest(d):
        failcount += 1
    if not compMultiTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Ejemplo n.º 5
0
Archivo: run.py Proyecto: venky74/steam
def main():
	failcount = 0
	d = setup()

	
	if not regressTest(d):
		failcount += 1
	#if not pythonTest(d):
	#	failcount += 1
	tu.endtest(d)


	sys.exit(failcount)
Ejemplo n.º 6
0
def main():
	failcount = 0
	d = tu.newtest()
	
	if not createTagTest(d):
		failcount += 1
	if not applyTagTest(d):
		failcount += 1
	if not multiTagTest(d):
		failcount += 1
	if not conflictTagTest(d):
		failcount += 1	
	if not deleteTagTest(d):
		failcount += 1
			
	tu.endtest(d)
	sys.exit(failcount)
Ejemplo n.º 7
0
Archivo: run.py Proyecto: venky74/steam
def main():
    failcount = 0
    d = tu.newtest()
    r = setup()

    if not writeumsTest(d, r):
        failcount += 1
    d.refresh()
    tu.goHome(d)
    if not createUserTest(d):
        failcount += 1
    if not createRoleTest(d):
        failcount += 1
    if not createRoleUserTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Ejemplo n.º 8
0
Archivo: run.py Proyecto: venky74/steam
def readUsersTest():
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    iden = [("joe", "shmoe"), ("jerry", "fairy"), ("Rick", "kimmy")]
    try:
        for i in iden:
            num = tu.createIdentity(i[0], i[1])
            tu.assignRole(num, 1)

    except:
        print "Failed to create idnetities"
        return False
    try:
        tu.goUsers(d)
        for i in iden:
            wait.until(lambda x: x.find_element_by_xpath(
                "//div[@class='cell' and text()='{0}']".format(i[0])))
    except:
        print "Users missing from users page"
        return False
    finally:
        tu.endtest(d)
    return True
Ejemplo n.º 9
0
Archivo: run.py Proyecto: venky74/steam
def main():
    failcount = 0

    d = tu.newtest()
    time.sleep(2)
    if not regressSortTest(d):
        failcount += 1
    tu.endtest(d)
    d = tu.newtest()
    time.sleep(2)
    if not binomSortTest(d):
        failcount += 1
    tu.endtest(d)
    d = tu.newtest()
    time.sleep(2)
    if not mulnomSortTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Ejemplo n.º 10
0
Archivo: run.py Proyecto: venky74/steam
def superShareTest():
    res = [True, True]
    tu.cliLogin("superuser", "superuser")
    wg = tu.createWorkgroup("supertest", "testin super share")
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    tu.newProject(d)
    tu.addCluster(d, "localhost", "54535", "steamtest")
    d.find_element_by_xpath("//div[@class='select-cluster']//button").click()
    tu.selectDataframe(d, "bank_full.hex")
    tu.selectModelCategory(d, "Regression")
    try:
        tu.selectModel(d, "regress")
        d.find_element_by_xpath(
            "//div[@class='name-project']//input").send_keys("supertest")
        d.find_element_by_xpath("//button[text()='Create Project']").click()
        wait.until(lambda x: x.find_element_by_xpath(
            "//div[@class='model-name' and text()='regress']"))
        tu.goProjectConfig(d)
        d.find_element_by_xpath("//button[text()='Create New Label']").click()
        wait.until(lambda x: x.find_element_by_xpath("//input[@name='name']").
                   is_displayed())
        d.find_element_by_xpath("//input[@name='name']").send_keys("taggy")
        d.find_element_by_xpath("//textarea[@name='description']").send_keys(
            "the taggiest tag")
        d.find_element_by_xpath("//button[text()='Save']").click()
        wait.until(lambda x: x.find_element_by_xpath(
            "//div[@class='label-name' and text()='taggy']").is_displayed())
    except:
        print "Failed to setup super sharing test"
        return False
    finally:
        tu.endtest(d)

    tu.shareEntity(6, 1, wg, 'edit')
    tu.shareEntity(9, 1, wg, 'edit')

    uid = tu.createIdentity("noperm", "noperm")
    tu.assignWorkgroup(uid, wg)
    d = tu.testAs("noperm", "noperm")
    try:
        #permissionless test
        tu.goProjects(d)
        if tu.viewProject(d, "supertest"):
            res[0] = False
            print "User with no permissions is able to view entities shared by superuser"
    except:
        res[0] = True
    finally:
        tu.endtest(d)

    uid = tu.createIdentity("yaperm", "yaperm")
    rid = tu.createRole("permissed", "for testing supershare",
                        [9, 10, 11, 12, 17, 18, 19, 20])
    tu.assignWorkgroup(uid, wg)
    tu.assignRole(uid, rid)
    d = tu.testAs("yaperm", "yaperm")
    try:
        #permissable test
        tu.goProjects(d)
        time.sleep(2)
        if not tu.viewProject(d, "supertest"):
            res[0] = False
            print "User could not see project shared by superuser"
    except:
        res[1] = False
        print "User with appropriate permissions is not able to view entities shared by superuser"
    finally:
        tu.endtest(d)
    return res[0] and res[1]
Ejemplo n.º 11
0
Archivo: run.py Proyecto: venky74/steam
def userShareTest():
    res = [True, True]
    uid = tu.createIdentity("setup", "setup")
    rid = tu.createRole("userole", "comfy af", [x for x in range(23) if x > 0])
    tu.assignRole(uid, rid)
    tu.cliLogin("setup", "setup")
    wg = tu.createWorkgroup("clusterwg", "for sharing the cluster")
    tu.assignWorkgroup(uid, wg)
    tu.cliLogin("superuser", "superuser")
    tu.shareEntity(5, 1, wg, 'edit')
    tu.cliLogin("setup", "setup")
    wg = tu.createWorkgroup("usertest", "testin user share")
    d = tu.testAs("setup", "setup")
    try:
        wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
        tu.newProject(d)
        time.sleep(2)
        d.find_element_by_xpath(
            "//div[@class='select-cluster']//button").click()
        tu.selectDataframe(d, "bank_full.hex")
        tu.selectModelCategory(d, "Regression")
        tu.selectModel(d, "gradi")
        d.find_element_by_xpath(
            "//div[@class='name-project']//input").send_keys("averagetest")
        d.find_element_by_xpath("//button[text()='Create Project']").click()
        wait.until(lambda x: x.find_element_by_xpath(
            "//div[@class='model-name' and text()='gradi']"))
    except Exception as e:
        print "Failed to setup user share test"
        return False
    finally:
        tu.endtest(d)

    tu.shareEntity(6, 2, wg, 'edit')
    tu.shareEntity(9, 2, wg, 'edit')

    uid = tu.createIdentity("permless", "permless")
    tu.cliLogin("superuser", "superuser")
    tu.assignWorkgroup(uid, wg)
    d = tu.testAs("permless", "permless")
    try:
        #permissionless test
        tu.goProjects(d)
        if tu.viewProject(d, "averagetest"):
            res[0] = False
            print "User with no permissions is able to view entities shared by non-superuser"
    except:
        res[0] = True
    finally:
        tu.endtest(d)

    uid = tu.createIdentity("useperm", "useperm")
    rid = tu.createRole("collmissed", "for testing usershare",
                        [9, 10, 11, 12, 17, 18, 19, 20])
    tu.assignWorkgroup(uid, wg)
    tu.assignRole(uid, rid)
    d = tu.testAs("useperm", "useperm")
    try:
        #permissable test
        tu.goProjects(d)
        if not tu.viewProject(d, "averagetest"):
            res[0] = False
            print "User could not see project shared by non-superuser"
    except:
        res[1] = False
        print "User with appropriate permissions is not able to view entities shared by non-superuser"
    finally:
        tu.endtest(d)

    return res[0] and res[1]
Ejemplo n.º 12
0
def main():
	failcount = 0
	d = tu.newtest()
	
	tu.endtest(d)
	sys.exit(failcount)