Skip to content

CLOUDSTACK-9099: SecretKey is returned from the APIs - #1996

Merged
karuturi merged 1 commit into
masterfrom
unknown repository
Jun 6, 2017
Merged

karuturi merged 1 commit into
masterfrom
unknown repository

Conversation

@jayapalu

@jayapalu jayapalu commented Mar 9, 2017

Copy link
Copy Markdown
Contributor

This PR closes the PR #1152

@yadvr

yadvr commented Mar 28, 2017

Copy link
Copy Markdown
Member

@jayapalu this is a useful security fix for 4.9 as well, can you please rebase against the 4.9 branch and edit the base branch of the PR to 4.9?

@jayapalu

jayapalu commented Apr 4, 2017

Copy link
Copy Markdown
Contributor Author

@rhtyd Once this PR got the LGTMs, I can rebase it on 4.9. Can you please review this PR

"Advanced",
Boolean.class,
"use.secret.key.in.response",
"true",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per discussion in PR # 1152, default value should be false. Any failing tests due to this change have to be fixed.

@kishankavala kishankavala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jayapalu

jayapalu commented Apr 7, 2017

Copy link
Copy Markdown
Contributor Author

It seems there is issue in CI due to that test are failing.

@yadvr

yadvr commented Apr 7, 2017

Copy link
Copy Markdown
Member

@jayapalu can you push -f to kick Travis?

responseObject = RegisterResponse.class,
requestHasSensitiveInfo = false,
responseHasSensitiveInfo = true,
authorized = {RoleType.User})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the 'since' parameter?

response.setSecretKey(keys.get(1));
}

response.setObjectName("listkeys");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 'userKeys'?

@Inject
private VpcManager vpcMgr;
@Inject
private AccountManager accountManager;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is a need to inject AccountManager? If the config key is a static it can be accessed as AccountManager.

@jayapalu

Copy link
Copy Markdown
Contributor Author

@koushik-das I have updated for your review comments.

@jayapalu

Copy link
Copy Markdown
Contributor Author

In the travis ci the tests are failing it could be because of timeout. But when I run some of the test locally it is passing.

The same test test_invalid_gw_nm is failing in travis ci.

=====my local xenserver setup test run ==========
nosetests-2.7 --with-marvin --marvin-config=/Users/jayapal_uradi/dev/advanced.cfg --with-xunit --xunit-file=/tmp/test/testslog /Users/jayapal_uradi/dev/github/cloudstack/test/integration/component/test_invalid_gw_nm.py --zone=zone1 --hypervisor=xenserver

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /tmp//MarvinLogs//Apr_14_2017_10_30_49_WKRPUW. All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
===final results are now copied to: /tmp//MarvinLogs/test_invalid_gw_nm_XQRFQU===
HSL007948:cloudstack jayapal_uradi$ vi /tmp//MarvinLogs/test_invalid_gw_nm_XQRFQU/
failed_plus_exceptions.txt results.txt runinfo.txt
HSL007948:cloudstack jayapal_uradi$ vi /tmp//MarvinLogs/test_invalid_gw_nm_XQRFQU/results.txt
HSL007948:cloudstack jayapal_uradi$ cat /tmp//MarvinLogs/test_invalid_gw_nm_XQRFQU/results.txt
test_isolated_nw_invalid_gw (integration.component.test_invalid_gw_nm.TestIsolatedNetworkInvalidGw) ... === TestName: test_isolated_nw_invalid_gw | Status : SUCCESS ===
ok


Ran 1 test in 5.837s

OK
================== End of my local setup test run ==================

https://travis-ci.org/apache/cloudstack/jobs/221647779

The command ./tools/travis/script.sh component/test_cpu_max_limits component/test_cpu_project_limits component/test_deploy_vm_userdata_multi_nic component/test_egress_fw_rules component/test_invalid_gw_nm component/test_ip_reservation component/test_lb_secondary_ip exited with 1

ContextSuite context=TestIsolatedNetw | exceptions.T | 0 | test_invalid_gw_nm |
| orkInvalidGw>:setup | ypeError | |

@koushik-das

Copy link
Copy Markdown
Contributor

Code changes LGTM

@jayapalu

Copy link
Copy Markdown
Contributor Author

When I run the few tests failed here run manually are passed in my local setup. There is setup issue in the travis CI.
@borisstoyanov Can you please trigger the Trillian on for PR.

@borisstoyanov

Copy link
Copy Markdown
Contributor

sure @jayapalu
@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-657

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1014)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 2869 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1996-t1014-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_affinity_groups_projects.py
Intermitten failure detected: /marvin/tests/smoke/test_affinity_groups.py
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vgpu_enabled_vm.py
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vm_iso.py
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vm_root_resize.py
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vms_with_varied_deploymentplanners.py
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vm_with_userdata.py
Intermitten failure detected: /marvin/tests/smoke/test_disk_offerings.py
Intermitten failure detected: /marvin/tests/smoke/test_dynamicroles.py
Intermitten failure detected: /marvin/tests/smoke/test_global_settings.py
Intermitten failure detected: /marvin/tests/smoke/test_guest_vlan_range.py
Intermitten failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermitten failure detected: /marvin/tests/smoke/test_iso.py
Intermitten failure detected: /marvin/tests/smoke/test_list_ids_parameter.py
Intermitten failure detected: /marvin/tests/smoke/test_loadbalance.py
Intermitten failure detected: /marvin/tests/smoke/test_login.py
Intermitten failure detected: /marvin/tests/smoke/test_metrics_api.py
Intermitten failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
Intermitten failure detected: /marvin/tests/smoke/test_nested_virtualization.py
Intermitten failure detected: /marvin/tests/smoke/test_network_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_network.py
Intermitten failure detected: /marvin/tests/smoke/test_nic_adapter_type.py
Intermitten failure detected: /marvin/tests/smoke/test_nic.py
Intermitten failure detected: /marvin/tests/smoke/test_non_contigiousvlan.py
Intermitten failure detected: /marvin/tests/smoke/test_outofbandmanagement.py
Intermitten failure detected: /marvin/tests/smoke/test_over_provisioning.py
Intermitten failure detected: /marvin/tests/smoke/test_password_server.py
Intermitten failure detected: /marvin/tests/smoke/test_portable_publicip.py
Intermitten failure detected: /marvin/tests/smoke/test_primary_storage.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_public_ip_range.py
Intermitten failure detected: /marvin/tests/smoke/test_pvlan.py
Intermitten failure detected: /marvin/tests/smoke/test_regions.py
Intermitten failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
Intermitten failure detected: /marvin/tests/smoke/test_resource_detail.py
Intermitten failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
Intermitten failure detected: /marvin/tests/smoke/test_router_dns.py
Intermitten failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermitten failure detected: /marvin/tests/smoke/test_routers.py
Intermitten failure detected: /marvin/tests/smoke/test_secondary_storage.py
Intermitten failure detected: /marvin/tests/smoke/test_service_offerings.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_ssvm.py
Intermitten failure detected: /marvin/tests/smoke/test_staticroles.py
Intermitten failure detected: /marvin/tests/smoke/test_templates.py
Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermitten failure detected: /marvin/tests/smoke/test_vm_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_router_nics.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Test completed. 5 look ok, 83 have error(s)

Test Result Time (s) Test File
ContextSuite context=TestVpcSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcRemoteAccessVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestRVPCSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVPCNics>:setup Error 0.00 test_vpc_router_nics.py
ContextSuite context=TestVPCRedundancy>:setup Error 0.00 test_vpc_redundant.py
ContextSuite context=TestVolumes>:setup Error 0.00 test_volumes.py
ContextSuite context=TestCreateVolume>:setup Error 0.00 test_volumes.py
ContextSuite context=TestVmSnapshot>:setup Error 0.01 test_vm_snapshots.py
ContextSuite context=TestVMLifeCycle>:setup Error 0.00 test_vm_life_cycle.py
ContextSuite context=TestDeployVM>:setup Error 0.00 test_vm_life_cycle.py
ContextSuite context=TestTemplates>:setup Error 0.00 test_templates.py
ContextSuite context=TestCreateTemplate>:setup Error 0.00 test_templates.py
test_static_role_account_acls Error 0.00 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Error 0.01 test_ssvm.py
test_10_destroy_cpvm Error 0.01 test_ssvm.py
test_09_destroy_ssvm Error 0.01 test_ssvm.py
test_08_reboot_cpvm Error 0.01 test_ssvm.py
test_07_reboot_ssvm Error 0.01 test_ssvm.py
test_06_stop_cpvm Error 0.01 test_ssvm.py
test_05_stop_ssvm Error 0.01 test_ssvm.py
test_04_cpvm_internals Error 0.01 test_ssvm.py
test_03_ssvm_internals Error 0.01 test_ssvm.py
test_02_list_cpvm_vm Error 0.01 test_ssvm.py
test_01_list_sec_storage_vm Error 0.01 test_ssvm.py
ContextSuite context=TestSnapshotRootDisk>:setup Error 0.00 test_snapshots.py
test_01_create_service_offering Error 0.01 test_service_offerings.py
ContextSuite context=TestServiceOfferings>:setup Error 0.02 test_service_offerings.py
test_02_sys_template_ready Error 0.00 test_secondary_storage.py
test_01_sys_vm_start Error 0.00 test_secondary_storage.py
ContextSuite context=TestRouterServices>:setup Error 0.00 test_routers.py
ContextSuite context=TestRouterDns>:setup Error 0.00 test_router_dns.py
ContextSuite context=TestRouterDHCPOpts>:setup Error 0.00 test_router_dhcphosts.py
ContextSuite context=TestRouterDHCPHosts>:setup Error 0.00 test_router_dhcphosts.py
ContextSuite context=TestResourceDetail>:setup Error 0.00 test_resource_detail.py
ContextSuite context=TestResetVmOnReboot>:setup Error 0.00 test_reset_vm_on_reboot.py
ContextSuite context=TestRegions>:setup Error 0.00 test_regions.py
test_create_pvlan_network Error 0.00 test_pvlan.py
ContextSuite context=TestDedicatePublicIPRange>:setup Error 0.00 test_public_ip_range.py
ContextSuite context=TestPrivateGwACL>:setup Error 0.00 test_privategw_acl.py
test_01_primary_storage_nfs Error 0.01 test_primary_storage.py
test_01_primary_storage_iscsi Error 0.01 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.01 test_primary_storage.py
ContextSuite context=TestPortablePublicIPRange>:setup Error 0.00 test_portable_publicip.py
ContextSuite context=TestPortablePublicIPAcquire>:setup Error 0.00 test_portable_publicip.py
ContextSuite context=TestIsolatedNetworksPasswdServer>:setup Error 0.00 test_password_server.py
test_UpdateStorageOverProvisioningFactor Error 0.01 test_over_provisioning.py
test_UpdateStorageOverProvisioningFactor Error 0.01 test_over_provisioning.py
ContextSuite context=TestOutOfBandManagement>:setup Error 0.00 test_outofbandmanagement.py
test_extendPhysicalNetworkVlan Error 0.00 test_non_contigiousvlan.py
test_01_nic Error 0.01 test_nic.py
test_releaseIP Error 0.01 test_network.py
test_reboot_router Error 0.01 test_network.py
test_delete_account Error 0.03 test_network.py
ContextSuite context=TestRouterRules>:setup Error 0.01 test_network.py
ContextSuite context=TestPublicIP>:setup Error 0.04 test_network.py
ContextSuite context=TestPortForwarding>:setup Error 0.04 test_network.py
ContextSuite context=TestNestedVirtualization>:setup Error 0.00 test_nested_virtualization.py
test_nic_secondaryip_add_remove Error 0.01 test_multipleips_per_nic.py
test_list_zones_metrics Error 0.01 test_metrics_api.py
test_list_volumes_metrics Error 0.01 test_metrics_api.py
test_list_vms_metrics Error 0.01 test_metrics_api.py
test_list_pstorage_metrics Error 0.01 test_metrics_api.py
test_list_infrastructure_metrics Error 0.01 test_metrics_api.py
test_list_hosts_metrics Error 0.01 test_metrics_api.py
test_list_clusters_metrics Error 0.01 test_metrics_api.py
login_test_saml_user Error 0.01 test_login.py
ContextSuite context=TestLoadBalance>:setup Error 0.00 test_loadbalance.py
ContextSuite context=TestListIdsParams>:setup Error 0.00 test_list_ids_parameter.py
test_01_create_iso Error 0.01 test_iso.py
ContextSuite context=TestISO>:setup Error 0.02 test_iso.py
ContextSuite context=TestInternalLb>:setup Error 0.00 test_internal_lb.py
ContextSuite context=TestDedicateGuestVlanRange>:setup Error 0.00 test_guest_vlan_range.py
test_UpdateConfigParamWithScope Error 0.00 test_global_settings.py
test_UpdateConfigParamWithScope Error 0.01 test_global_settings.py
test_rolepermission_lifecycle_update Error 0.00 test_dynamicroles.py
test_rolepermission_lifecycle_list Error 0.00 test_dynamicroles.py
test_rolepermission_lifecycle_delete Error 0.00 test_dynamicroles.py
test_rolepermission_lifecycle_create Error 0.00 test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updates Error 0.00 test_dynamicroles.py
test_role_lifecycle_update_role_inuse Error 0.00 test_dynamicroles.py
test_role_lifecycle_update Error 0.00 test_dynamicroles.py
test_role_lifecycle_list Error 0.00 test_dynamicroles.py
test_role_lifecycle_delete Error 0.00 test_dynamicroles.py
test_role_lifecycle_create Error 0.00 test_dynamicroles.py
test_role_inuse_deletion Error 0.00 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Error 0.00 test_dynamicroles.py
test_role_account_acls Error 0.00 test_dynamicroles.py
test_default_role_deletion Error 0.00 test_dynamicroles.py
test_04_create_fat_type_disk_offering Error 0.01 test_disk_offerings.py
test_02_create_sparse_type_disk_offering Error 0.01 test_disk_offerings.py
test_01_create_disk_offering Error 0.01 test_disk_offerings.py
ContextSuite context=TestDiskOfferings>:setup Error 0.01 test_disk_offerings.py
ContextSuite context=TestDeployVmWithVariedPlanners>:setup Error 0.00 test_deploy_vms_with_varied_deploymentplanners.py
ContextSuite context=TestDeployVmWithUserData>:setup Error 0.00 test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resize Error 0.00 test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resize Error 0.00 test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resize Error 0.00 test_deploy_vm_root_resize.py
ContextSuite context=TestDeployVMFromISO>:setup Error 0.00 test_deploy_vm_iso.py
ContextSuite context=TestDeployvGPUenabledVM>:setup Error 0.00 test_deploy_vgpu_enabled_vm.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setup Error 0.00 test_affinity_groups.py
test_change_service_offering_for_vm_with_snapshots Skipped 0.00 test_vm_snapshots.py
test_01_scale_vm Skipped 0.00 test_scale_vm.py

@jayapalu

jayapalu commented Apr 20, 2017 •

Copy link
Copy Markdown
Contributor Author

@borisstoyanov In this PR the secretkey is removed from the user apis (list, create, disable, enable, get, lock and updateuser) and (list, disable, enable and updateaccount) response. Can you please check confirm Is this the reason for failure.
In the PR discussion it is concluded that we need to update the test cases to use api 'getUserKeys' to get the api/secretkey.

@jayapalu

Copy link
Copy Markdown
Contributor Author

@borisstoyanov Can you please look into my previous comment on test failures.

@jayapalu

jayapalu commented Apr 26, 2017 •

Copy link
Copy Markdown
Contributor Author

@borisstoyanov
I am able to reproduce the issue. I am working on correcting the test cases.

@borisstoyanov

Copy link
Copy Markdown
Contributor

Hi @jayapalu, sorry I didn't come back to you earlier, please let me know when you have the fix so we could retest again.

@jayapalu

jayapalu commented May 2, 2017 •

Copy link
Copy Markdown
Contributor Author

@borisstoyanov Can you upload the your "mgtSvr" section from the marvin config file. I am getting the error when port is 8080 and apikey and secretkey is empty. I want to confirm that your/trillian has the same configuration.
"mgtSvr": [
{
"mgtSvrIp": "10.233.88.88",
"passwd": "password",
"user": "root",
"port": 8080,
"useHttps": "False",
"certCAPath": "NA",
"certPath": "NA",
"apiKey": "",
"securityKey": ""
}
]

@jayapalu

jayapalu commented May 3, 2017

Copy link
Copy Markdown
Contributor Author

@borisstoyanov In marvin config with port 8080 and without keys, Is this valid configuration test ? Because with port 8080 and with out keys there is no way to get the keys first time unless it uses 8096 for the first time and then fall back to 8080

@borisstoyanov

Copy link
Copy Markdown
Contributor

Hi @jayapalu, sorry for the delay,
we're using port 8096 in the config file and no API keys are configured in the cfg file. Are you able to execute the tests successfully, if yes can you share your config.

@jayapalu

jayapalu commented May 4, 2017

Copy link
Copy Markdown
Contributor Author

@borisstoyanov With 8096, I did not get see any test failures in my local setup. But in Trillian it seems the test setup itself is failing.

@jayapalu

jayapalu commented May 5, 2017

Copy link
Copy Markdown
Contributor Author

Previously Travis CI is failed. Now Travis CI is passed.

@borisstoyanov

Copy link
Copy Markdown
Contributor

Hi @jayapalu,
try setting API keys to the admin user and execute the tests again. I think that's the difference between Trillian environments and your instance.

@jayapalu

jayapalu commented May 5, 2017

Copy link
Copy Markdown
Contributor Author

@borisstoyanov Now Travis CI is passed can you please trigger the Trillian.

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

responseObject = RegisterResponse.class,
requestHasSensitiveInfo = false,
responseHasSensitiveInfo = true,
authorized = {RoleType.User},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're allowing users, please allow all the role types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One doubt here, if user is allowed why need to allow admin explicitly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayapalu the authorized field gets all the roles that need to be authorized (default) when the rules are not defined in commands.properties or in the dynamic roles (role_permissions) table.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayapalu I still don't see the change, please update or force push your branch?

private Long id;

public static final Logger s_logger = Logger.getLogger(RegisterCmd.class.getName());
public static final String s_name = "getuserkeysresponse";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayapalu can we get rid of archai way of variable declaration and API implementation, for example see this API: https://github.com/apache/cloudstack/blob/master/api/src/org/apache/cloudstack/api/command/admin/acl/ListRolesCmd.java#L46

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


public static UserResponse newUserResponse(UserAccountJoinVO usr, Long domainId) {
UserResponse response = s_userAccountJoinDao.newUserResponse(usr);
if(AccountManager.UseSecretKeyInResponse.value() == false){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use !?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return _accountDao.findUserAccountByApiKey(apiKey);
}

@Override

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a list should this be a Pair (keypair) of string, and rename the method as getUserKeyPair() ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if(s_logger.isDebugEnabled()){
s_logger.debug("Access granted to " + user + "to " + entity + "by " + checker.getName());
}
return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayapalu is it assumed that checkAccess throws no exception? Can such a case happen where depending on the sequence of security checkers, we might allow an entity that may be failed by some other checker, i.e. should we return here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about it. But if you look at all the checkAccess methods in this file has the same pattern.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough


accountManager.getKeys(_listkeyscmd);

}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix braces please }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@yadvr

yadvr commented May 10, 2017

Copy link
Copy Markdown
Member

With this PR, the user keypair (api key and secret key) which used to be in listUsers API response will now be returned by new getUserKeys API response that is allowed for User role type only (qq - we should allow all role types, if we're allowing the RoleType.User) -- does this beat the purpose of exposing user keypair? I do see the value of exposing this as a separate API though.

@yadvr

yadvr commented May 17, 2017

Copy link
Copy Markdown
Member

@jayapalu I still don't see the change, please update or force push your branch?
I'll continue review once you're done pushing new changes

@jayapalu

Copy link
Copy Markdown
Contributor Author

@rhtyd Updated check now.

@yadvr

yadvr commented May 17, 2017

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-730

@yadvr

yadvr commented May 17, 2017

Copy link
Copy Markdown
Member

@blueorangutan test centos7 vmware-55u3

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1102)
Environment: vmware-55u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42516 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1996-t1102-vmware-55u3.zip
Intermitten failure detected: /marvin/tests/smoke/test_deploy_vm_root_resize.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Test completed. 48 look ok, 4 have error(s)

Test Result Time (s) Test File
test_01_create_volume Failure 152.19 test_volumes.py
test_04_rvpc_privategw_static_routes Failure 874.02 test_privategw_acl.py
ContextSuite context=TestDeployVmRootSize>:setup Error 0.00 test_deploy_vm_root_resize.py
test_01_vpc_site2site_vpn Success 416.89 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Success 156.78 test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpn Success 728.58 test_vpc_vpn.py
test_02_VPC_default_routes Success 380.04 test_vpc_router_nics.py
test_01_VPC_nics_after_destroy Success 695.60 test_vpc_router_nics.py
test_05_rvpc_multi_tiers Success 832.25 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Success 1524.02 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Success 664.00 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Success 775.79 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Success 1412.00 test_vpc_redundant.py
test_09_delete_detached_volume Success 35.91 test_volumes.py
test_06_download_detached_volume Success 70.63 test_volumes.py
test_05_detach_volume Success 100.28 test_volumes.py
test_04_delete_attached_volume Success 20.25 test_volumes.py
test_03_download_attached_volume Success 15.27 test_volumes.py
test_02_attach_volume Success 64.86 test_volumes.py
test_change_service_offering_for_vm_with_snapshots Success 422.81 test_vm_snapshots.py
test_03_delete_vm_snapshots Success 275.20 test_vm_snapshots.py
test_02_revert_vm_snapshots Success 194.28 test_vm_snapshots.py
test_01_create_vm_snapshots Success 158.56 test_vm_snapshots.py
test_deploy_vm_multiple Success 217.44 test_vm_life_cycle.py
test_deploy_vm Success 0.03 test_vm_life_cycle.py
test_advZoneVirtualRouter Success 0.02 test_vm_life_cycle.py
test_10_attachAndDetach_iso Success 26.77 test_vm_life_cycle.py
test_09_expunge_vm Success 125.22 test_vm_life_cycle.py
test_08_migrate_vm Success 66.16 test_vm_life_cycle.py
test_07_restore_vm Success 0.17 test_vm_life_cycle.py
test_06_destroy_vm Success 10.16 test_vm_life_cycle.py
test_03_reboot_vm Success 5.20 test_vm_life_cycle.py
test_02_start_vm Success 25.28 test_vm_life_cycle.py
test_01_stop_vm Success 10.15 test_vm_life_cycle.py
test_CreateTemplateWithDuplicateName Success 261.69 test_templates.py
test_08_list_system_templates Success 0.03 test_templates.py
test_07_list_public_templates Success 0.04 test_templates.py
test_05_template_permissions Success 0.05 test_templates.py
test_04_extract_template Success 20.45 test_templates.py
test_03_delete_template Success 5.12 test_templates.py
test_02_edit_template Success 90.13 test_templates.py
test_01_create_template Success 106.00 test_templates.py
test_10_destroy_cpvm Success 296.94 test_ssvm.py
test_09_destroy_ssvm Success 268.82 test_ssvm.py
test_08_reboot_cpvm Success 126.46 test_ssvm.py
test_07_reboot_ssvm Success 158.28 test_ssvm.py
test_06_stop_cpvm Success 176.81 test_ssvm.py
test_05_stop_ssvm Success 213.73 test_ssvm.py
test_04_cpvm_internals Success 1.12 test_ssvm.py
test_03_ssvm_internals Success 3.07 test_ssvm.py
test_02_list_cpvm_vm Success 0.11 test_ssvm.py
test_01_list_sec_storage_vm Success 0.13 test_ssvm.py
test_02_list_snapshots_with_removed_data_store Success 182.68 test_snapshots.py
test_01_snapshot_root_disk Success 26.28 test_snapshots.py
test_04_change_offering_small Success 96.93 test_service_offerings.py
test_03_delete_service_offering Success 0.05 test_service_offerings.py
test_02_edit_service_offering Success 0.10 test_service_offerings.py
test_01_create_service_offering Success 0.10 test_service_offerings.py
test_02_sys_template_ready Success 0.13 test_secondary_storage.py
test_01_sys_vm_start Success 0.17 test_secondary_storage.py
test_09_reboot_router Success 125.80 test_routers.py
test_08_start_router Success 110.75 test_routers.py
test_07_stop_router Success 20.22 test_routers.py
test_06_router_advanced Success 0.07 test_routers.py
test_05_router_basic Success 0.04 test_routers.py
test_04_restart_network_wo_cleanup Success 5.64 test_routers.py
test_03_restart_network_cleanup Success 130.93 test_routers.py
test_02_router_internal_adv Success 1.10 test_routers.py
test_01_router_internal_basic Success 0.57 test_routers.py
test_router_dns_guestipquery Success 76.62 test_router_dns.py
test_router_dns_externalipquery Success 0.09 test_router_dns.py
test_router_dhcphosts Success 186.36 test_router_dhcphosts.py
test_router_dhcp_opts Success 21.63 test_router_dhcphosts.py
test_01_updatevolumedetail Success 5.12 test_resource_detail.py
test_01_reset_vm_on_reboot Success 60.55 test_reset_vm_on_reboot.py
test_createRegion Success 0.04 test_regions.py
test_create_pvlan_network Success 5.20 test_pvlan.py
test_dedicatePublicIpRange Success 0.43 test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanup Success 1018.61 test_privategw_acl.py
test_02_vpc_privategw_static_routes Success 727.55 test_privategw_acl.py
test_01_vpc_privategw_acl Success 238.19 test_privategw_acl.py
test_03_migration_options_storage_tags Success 37.32 test_primary_storage.py
test_02_edit_primary_storage_tags Success 0.15 test_primary_storage.py
test_01_primary_storage_nfs Success 36.48 test_primary_storage.py
test_01_deploy_vms_storage_tags Success 46.76 test_primary_storage.py
test_createPortablePublicIPRange Success 15.20 test_portable_publicip.py
test_createPortablePublicIPAcquire Success 15.52 test_portable_publicip.py
test_isolate_network_password_server Success 89.26 test_password_server.py
test_UpdateStorageOverProvisioningFactor Success 0.12 test_over_provisioning.py
test_oobm_zchange_password Success 30.77 test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownership Success 11.33 test_outofbandmanagement.py
test_oobm_issue_power_status Success 10.29 test_outofbandmanagement.py
test_oobm_issue_power_soft Success 15.34 test_outofbandmanagement.py
test_oobm_issue_power_reset Success 10.35 test_outofbandmanagement.py
test_oobm_issue_power_on Success 15.38 test_outofbandmanagement.py
test_oobm_issue_power_off Success 15.38 test_outofbandmanagement.py
test_oobm_issue_power_cycle Success 15.38 test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzones Success 92.68 test_outofbandmanagement.py
test_oobm_enable_feature_valid Success 5.15 test_outofbandmanagement.py
test_oobm_enable_feature_invalid Success 5.12 test_outofbandmanagement.py
test_oobm_disable_feature_valid Success 5.18 test_outofbandmanagement.py
test_oobm_disable_feature_invalid Success 0.10 test_outofbandmanagement.py
test_oobm_configure_invalid_driver Success 0.09 test_outofbandmanagement.py
test_oobm_configure_default_driver Success 0.08 test_outofbandmanagement.py
test_oobm_background_powerstate_sync Success 23.38 test_outofbandmanagement.py
test_extendPhysicalNetworkVlan Success 15.33 test_non_contigiousvlan.py
test_01_nic Success 515.47 test_nic.py
test_releaseIP Success 248.11 test_network.py
test_reboot_router Success 574.73 test_network.py
test_public_ip_user_account Success 10.30 test_network.py
test_public_ip_admin_account Success 40.27 test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_Rule Success 76.90 test_network.py
test_network_rules_acquired_public_ip_2_nat_rule Success 61.79 test_network.py
test_network_rules_acquired_public_ip_1_static_nat_rule Success 125.06 test_network.py
test_delete_account Success 277.97 test_network.py
test_02_port_fwd_on_non_src_nat Success 55.74 test_network.py
test_01_port_fwd_on_src_nat Success 111.84 test_network.py
test_nested_virtualization_vmware Success 398.70 test_nested_virtualization.py
test_nic_secondaryip_add_remove Success 257.97 test_multipleips_per_nic.py
test_list_zones_metrics Success 0.23 test_metrics_api.py
test_list_volumes_metrics Success 5.55 test_metrics_api.py
test_list_vms_metrics Success 181.74 test_metrics_api.py
test_list_pstorage_metrics Success 0.30 test_metrics_api.py
test_list_infrastructure_metrics Success 0.49 test_metrics_api.py
test_list_hosts_metrics Success 0.33 test_metrics_api.py
test_list_clusters_metrics Success 0.32 test_metrics_api.py
login_test_saml_user Success 19.38 test_login.py
test_assign_and_removal_lb Success 148.10 test_loadbalance.py
test_02_create_lb_rule_non_nat Success 207.19 test_loadbalance.py
test_01_create_lb_rule_src_nat Success 207.57 test_loadbalance.py
test_03_list_snapshots Success 0.08 test_list_ids_parameter.py
test_02_list_templates Success 0.04 test_list_ids_parameter.py
test_01_list_volumes Success 0.04 test_list_ids_parameter.py
test_07_list_default_iso Success 0.06 test_iso.py
test_05_iso_permissions Success 0.06 test_iso.py
test_04_extract_Iso Success 5.17 test_iso.py
test_03_delete_iso Success 95.18 test_iso.py
test_02_edit_iso Success 0.08 test_iso.py
test_01_create_iso Success 20.98 test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfaces Success 484.75 test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfaces Success 384.78 test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 Success 1003.91 test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 Success 888.82 test_internal_lb.py
test_dedicateGuestVlanRange Success 10.26 test_guest_vlan_range.py
test_UpdateConfigParamWithScope Success 0.14 test_global_settings.py
test_rolepermission_lifecycle_update Success 6.20 test_dynamicroles.py
test_rolepermission_lifecycle_list Success 6.11 test_dynamicroles.py
test_rolepermission_lifecycle_delete Success 5.86 test_dynamicroles.py
test_rolepermission_lifecycle_create Success 5.86 test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updates Success 6.04 test_dynamicroles.py
test_role_lifecycle_update_role_inuse Success 5.92 test_dynamicroles.py
test_role_lifecycle_update Success 10.99 test_dynamicroles.py
test_role_lifecycle_list Success 5.96 test_dynamicroles.py
test_role_lifecycle_delete Success 10.93 test_dynamicroles.py
test_role_lifecycle_create Success 5.90 test_dynamicroles.py
test_role_inuse_deletion Success 5.85 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Success 8.15 test_dynamicroles.py
test_role_account_acls Success 9.03 test_dynamicroles.py
test_default_role_deletion Success 6.06 test_dynamicroles.py
test_04_create_fat_type_disk_offering Success 0.07 test_disk_offerings.py
test_03_delete_disk_offering Success 0.04 test_disk_offerings.py
test_02_edit_disk_offering Success 0.05 test_disk_offerings.py
test_02_create_sparse_type_disk_offering Success 0.07 test_disk_offerings.py
test_01_create_disk_offering Success 0.11 test_disk_offerings.py
test_deployvm_userdispersing Success 55.92 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentrated Success 106.16 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfit Success 206.65 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_post Success 25.52 test_deploy_vm_with_userdata.py
test_deployvm_userdata Success 136.37 test_deploy_vm_with_userdata.py
test_deploy_vm_from_iso Success 182.48 test_deploy_vm_iso.py
test_3d_gpu_support Success 435.35 test_deploy_vgpu_enabled_vm.py
test_DeployVmAntiAffinityGroup Success 227.26 test_affinity_groups.py
test_08_resize_volume Skipped 10.15 test_volumes.py
test_07_resize_fail Skipped 15.27 test_volumes.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.02 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Skipped 0.02 test_ssvm.py
test_01_scale_vm Skipped 66.29 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.04 test_primary_storage.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_06_verify_guest_lspci_again Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_05_change_vm_ostype_restart Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_04_verify_guest_lspci Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_03_verify_libvirt_attach_disk Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_02_verify_libvirt_after_restart Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_01_verify_libvirt Skipped 0.00 test_deploy_virtio_scsi_vm.py
test_deploy_vgpu_enabled_vm Skipped 1.31 test_deploy_vgpu_enabled_vm.py

@jayapalu

Copy link
Copy Markdown
Contributor Author

@rhtyd Can you please review the changes.

@cloudmonger

Copy link
Copy Markdown

ACS CI BVT Run

Sumarry:
Build Number 717
Hypervisor xenserver
NetworkType Advanced
Passed=108
Failed=2
Skipped=12

Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0

Failed tests:

  • test_list_ids_parameter.py

  • ContextSuite context=TestListIdsParams>:setup Failing since 17 runs

  • test_routers_network_ops.py

  • test_03_RVR_Network_check_router_state Failed

Skipped tests:
test_vm_nic_adapter_vmxnet3
test_01_verify_libvirt
test_02_verify_libvirt_after_restart
test_03_verify_libvirt_attach_disk
test_04_verify_guest_lspci
test_05_change_vm_ostype_restart
test_06_verify_guest_lspci_again
test_static_role_account_acls
test_11_ss_nfs_version_on_ssvm
test_nested_virtualization_vmware
test_3d_gpu_support
test_deploy_vgpu_enabled_vm

Passed test suits:
test_deploy_vm_with_userdata.py
test_affinity_groups_projects.py
test_portable_publicip.py
test_vm_snapshots.py
test_over_provisioning.py
test_global_settings.py
test_scale_vm.py
test_service_offerings.py
test_routers_iptables_default_policy.py
test_loadbalance.py
test_routers.py
test_reset_vm_on_reboot.py
test_deploy_vms_with_varied_deploymentplanners.py
test_network.py
test_router_dns.py
test_non_contigiousvlan.py
test_login.py
test_deploy_vm_iso.py
test_public_ip_range.py
test_multipleips_per_nic.py
test_metrics_api.py
test_regions.py
test_affinity_groups.py
test_network_acl.py
test_pvlan.py
test_volumes.py
test_nic.py
test_deploy_vm_root_resize.py
test_resource_detail.py
test_secondary_storage.py
test_vm_life_cycle.py
test_disk_offerings.py

@jayapalu

Copy link
Copy Markdown
Contributor Author

@rhtyd can you review the changes I have made for your review comments.

@jayapalu

Copy link
Copy Markdown
Contributor Author

@rhtyd ping

@jayapalu

Copy link
Copy Markdown
Contributor Author

I have made the changes changes suggested @rhtyd .
Waited and pinged for the reviewer for 6 days. No response from the reviewer, marking merge ready. Let me know if any comments are there on the code.

@yadvr

yadvr commented Jul 23, 2017

Copy link
Copy Markdown
Member

@jayapalu can you fix the regression, test failure in test_user_key_renew_same_account? Several travis runs are failing due to failure in this test, possibly caused by this PR. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants