Package com.axemblr.provisionr.api.access

Examples of com.axemblr.provisionr.api.access.AdminAccess


        final Network network = Network.builder().addRules(
            Rule.builder().anySource().port(22).tcp().createRule(),
            Rule.builder().anySource().port(8088).tcp().createRule()
        ).createNetwork();

        final AdminAccess adminAccess = AdminAccess.builder().username("admin").publicKey("ssh-rsa AAAAB3N")
            .privateKey("-----BEGIN RSA PRIVATE KEY-----\n").createAdminAccess();

        final Software software = Software.builder()
            .packages("hadoop-0.20", "hadoop-0.20-native").createSoftware();
View Full Code Here


            .createNetwork();

        final Software software = Software.builder().baseOperatingSystem("ubuntu-10.04")
            .packages("nginx").createSoftware();

        final AdminAccess adminAccess = AdminAccess.builder().asCurrentUser().createAdminAccess();

        final Hardware hardware = Hardware.builder().type("offering").createHardware();

        final Pool pool = Pool.builder().network(network).provider(provider).adminAccess(adminAccess)
            .software(software).hardware(hardware).minSize(1).expectedSize(1).createPool();
View Full Code Here

        super.tearDown();
    }

    @Test
    public void testEnsureKeyPairExists() throws Exception {
        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

        logKeyPairs();
        logVirtualMachines();
        execution = mock(DelegateExecution.class);
        pool = mock(Pool.class);

        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

        super.tearDown();
    }

    @Test
    public void testDeleteKeyPair() throws Exception {
        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

    @Test
    public void testCreatePuppetScript() throws Exception {
        Pool pool = mock(Pool.class);

        final AdminAccess adminAccess = AdminAccess.builder()
            .privateKey(TestConstants.PRIVATE_KEY)
            .publicKey(TestConstants.PUBLIC_KEY)
            .username(System.getProperty("user.name"))
            .createAdminAccess();

        when(pool.getAdminAccess()).thenReturn(adminAccess);

        PuppetActivity activity = new SetupAdminAccess();
        String content = activity.createPuppetScript(pool, null);

        final String username = adminAccess.getUsername();

        assertThat(content).contains(username)
            .contains(adminAccess.getPublicKey().split(" ")[1])
            .contains(String.format("user { \"%s\":", username))
            .contains(String.format("file { \"/home/%s/.ssh\":", username));
    }
View Full Code Here

        super.tearDown();
    }

    @Test
    public void testDeleteKeyPair() throws Exception {
        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
        execution = mock(DelegateExecution.class);
        pool = mock(Pool.class);

        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

        super.tearDown();
    }

    @Test
    public void testEnsureKeyPairExists() throws Exception {
        final AdminAccess adminAccess = AdminAccess.builder()
            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();
View Full Code Here

            Rule.builder().anySource().port(22).protocol(Protocol.TCP).createRule()
        ).createNetwork();

        final Hardware hardware = Hardware.builder().type("t1.micro").createHardware();

        final AdminAccess adminAccess = AdminAccess.builder().asCurrentUser().createAdminAccess();

        final String destinationPath = "/home/" + adminAccess.getUsername() + "/axemblr.html";
        final Software software = Software.builder()
            .baseOperatingSystem("ubuntu-12.04")
            .file("http://axemblr.com", destinationPath)
            .createSoftware();
View Full Code Here

TOP

Related Classes of com.axemblr.provisionr.api.access.AdminAccess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.