cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-8607) As an Operator I want to be able to change the host password on the host itself via the updateHostPassword API
Date Mon, 06 Jul 2015 11:32:04 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-8607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614902#comment-14614902
] 

ASF GitHub Bot commented on CLOUDSTACK-8607:
--------------------------------------------

Github user wilderrodrigues commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/559#discussion_r33925325
  
    --- Diff: plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixRequestWrapperTest.java
---
    @@ -1320,14 +1322,23 @@ public void testOvsDestroyTunnelCommandFailed() {
     
         @Test
         public void testUpdateHostPasswordCommand() {
    -        final UpdateHostPasswordCommand updatePwd = new UpdateHostPasswordCommand("test",
"123");
    +        final ExecutionResult executionResult = Mockito.mock(ExecutionResult.class);
    +
    +        final UpdateHostPasswordCommand updatePwd = new UpdateHostPasswordCommand("test",
"123", "127.0.0.1");
    +
    +        final StringBuffer buff = new StringBuffer();
    +        buff.append(updatePwd.getUsername());
    +        buff.append(' ');
    +        buff.append(updatePwd.getNewPassword());
    +
    +        when(citrixResourceBase.executeInVR(updatePwd.getHostIp(), VRScripts.UPDATE_HOST_PASSWD,
buff.toString())).thenReturn(executionResult);
    --- End diff --
    
    That's what I was discussing with @DaanHoogland here. In order to make it better, we have
to extract the Script creation into the existing utilities class and mock it. So we can cover
both false/true cases.
    
    But wait, whilst reading both of your comments again, I realised that I was looking into
the wrong test file. It might have been result of a initial version of the test. The mock
+ the when() call should not be there at all.
    
    That's how I will proceed:
    
    1. remove the unused Mock/call
    2. extract the SshHelper so we can cover both scenarios
    3. apply the similar changes to LibvirtUpdateHostPasswordCommandWrapper
    
    Sorry for the misunderstanding.
    
    Cheers,
    Wilder



> As an Operator I want to be able to change the host password on the host itself via the
updateHostPassword API
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8607
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8607
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: KVM, XenServer
>            Reporter: Wilder Rodrigues
>            Assignee: Wilder Rodrigues
>             Fix For: 4.6.0
>
>
> 1. Change the API to offer a flag to decide to update the host or not
>    - The default should be false
>    - The flag is not mandatory
> 2. When the flag is informed and true, in case of communication error with the host we
have to rollback the DB changes
> 3. In case of XenServer, do not allow single host update
>    - Update shall be done only when the cluster ID is informed
>    - It doesn't apply for KVM



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message