OpenStack Tempest Puppet Module
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.pp 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. # class for installing and configuring tempest
  2. #
  3. # The class checks out the tempest repo and sets the basic config.
  4. #
  5. # Note that only parameters for which values are provided will be
  6. # managed in tempest.conf.
  7. #
  8. # [*package_ensure*]
  9. # (optional) The state of tempest packages
  10. # Defaults to 'present'
  11. # [*tempest_workspace*]
  12. # Deafults to '/var/lib/tempest'
  13. # [*install_from_source*]
  14. # Defaults to true
  15. # [*git_clone*]
  16. # Defaults to true
  17. # [*tempest_config_file*]
  18. # Defaults to '/var/lib/tempest/etc/tempest.conf'
  19. # [*tempest_repo_uri*]
  20. # Defaults to 'git://github.com/openstack/tempest.git'
  21. # [*tempest_repo_revision*]
  22. # Defaults to undef
  23. # [*tempest_clone_path*]
  24. # Defaults to '/var/lib/tempest'
  25. # [*tempest_clone_owner*]
  26. # Defaults to 'root'
  27. # [*setup_venv*]
  28. # Defaults to false
  29. # [*configure_images*]
  30. # Defaults to true
  31. # [*image_name*]
  32. # Defaults to undef
  33. # [*image_name_alt*]
  34. # Defaults to undef
  35. # [*glance_v1*]
  36. # Defaults to true
  37. # [*glance_v2*]
  38. # Defaults to true
  39. # [*configure_networks*]
  40. # Defaults to true
  41. # [*l2gw_switch*]
  42. # Defaults to undef
  43. # [*public_network_name*]
  44. # Defaults to undef
  45. # [*neutron_api_extensions*]
  46. # Defaults to undef
  47. # [*identity_uri*]
  48. # Defaults to undef
  49. # [*identity_uri_v3*]
  50. # Defaults to undef
  51. # [*cli_dir*]
  52. # Defaults to undef
  53. # [*lock_path*]
  54. # Defaults to '/var/lib/tempest'
  55. # [*log_file*]
  56. # Defaults to $::os_service_default
  57. # [*debug*]
  58. # Defaults to false
  59. # [*use_stderr*]
  60. # Defaults to true
  61. # [*use_syslog*]
  62. # Defaults to false
  63. # [*logging_context_format_string*]
  64. # Defaults to $::os_service_default
  65. # [*username*]
  66. # Defaults to undef
  67. # [*password*]
  68. # Defaults to undef
  69. # [*project_name*]
  70. # Defaults to undef
  71. # [*alt_username*]
  72. # Defaults to undef
  73. # [*alt_password*]
  74. # Defaults to undef
  75. # [*alt_project_name*]
  76. # Defaults to undef
  77. # [*admin_username*]
  78. # Defaults to undef
  79. # [*admin_password*]
  80. # Defaults to undef
  81. # [*admin_project_name*]
  82. # Defaults to undef
  83. # [*admin_role*]
  84. # Defaults to undef
  85. # [*admin_domain_name*]
  86. # Defaults to undef
  87. # [*image_ref*]
  88. # Defaults to undef
  89. # [*image_ref_alt*]
  90. # Defaults to undef
  91. # [*image_ssh_user*]
  92. # Defaults to undef
  93. # [*image_alt_ssh_user*]
  94. # Defaults to undef
  95. # [*run_ssh*]
  96. # Defaults to false
  97. # [*flavor_ref*]
  98. # Defaults to undef
  99. # [*flavor_ref_alt*]
  100. # Defaults to undef
  101. # [*whitebox_db_uri*]
  102. # Defaults to undef
  103. # [*resize_available*]
  104. # Defaults to false
  105. # [*change_password_available*]
  106. # Defaults to undef
  107. # [*use_dynamic_credentials*]
  108. # Defaults to undef
  109. # [*public_network_id*]
  110. # Defaults to undef
  111. # [*public_router_id*]
  112. # Defaults to ''
  113. # [*sahara_plugins*]
  114. # (optional) List of enabled Sahara plugins
  115. # Defaults to undef
  116. # [*cinder_available*]
  117. # Defaults to true
  118. # [*cinder_backup_available*]
  119. # Defaults to false
  120. # [*glance_available*]
  121. # Defaults to true
  122. # [*heat_available*]
  123. # Defaults to false
  124. # [*ceilometer_available*]
  125. # Defaults to false
  126. # [*aodh_available*]
  127. # Defaults to false
  128. # [*gnocchi_available*]
  129. # Defaults to false
  130. # [*panko_available*]
  131. # Defaults to false
  132. # [*designate_available*]
  133. # Defaults to false
  134. # [*horizon_available*]
  135. # Defaults to true
  136. # [*neutron_available*]
  137. # Defaults to false
  138. # [*neutron_bgpvpn_available*]
  139. # Defaults to false
  140. # [*neutron_fwaas_available*]
  141. # Defaults to true
  142. # [*neutron_l2gw_available*]
  143. # Defaults to true
  144. # [*neutron_vpnaas_available*]
  145. # Defaults to false
  146. # [*neutron_dr_available*]
  147. # Defaults to false
  148. # [*nova_available*]
  149. # Defaults to true
  150. # [*murano_available*]
  151. # Defaults to false
  152. # [*watcher_available*]
  153. # Defaults to false
  154. # [*zaqar_available*]
  155. # Defaults to false
  156. # [*ec2api_available*]
  157. # Defaults to false
  158. # [*mistral_available*]
  159. # Defaults to false
  160. # [*vitrage_available*]
  161. # Defaults to false
  162. # [*run_service_broker_tests*]
  163. # Defaults to false
  164. # [*sahara_available*]
  165. # Defaults to false
  166. # [*swift_available*]
  167. # Defaults to false
  168. # [*trove_available*]
  169. # Defaults to false
  170. # [*ironic_available*]
  171. # Defaults to false
  172. # [*congress_available*]
  173. # Defaults to false
  174. # [*octavia_available*]
  175. # Defaults to false
  176. # [*barbican_available*]
  177. # Defaults to false
  178. # [*keystone_v2*]
  179. # Defaults to false
  180. # [*keystone_v3*]
  181. # Defaults to true
  182. # [*auth_version*]
  183. # Defaults to 'v3'
  184. # [*img_dir*]
  185. # Defaults to '/var/lib/tempest'
  186. # [*img_file*]
  187. # Defaults to 'cirros-0.4.0-x86_64-disk.img'
  188. # [*login_url*]
  189. # Defaults to undef
  190. # [*dashboard_url*]
  191. # Defaults to undef
  192. # [*disable_dashboard_ssl_validation*]
  193. # Defaults to undef
  194. # [*compute_build_interval*]
  195. # Defaults to undef
  196. # [*ca_certificates_file*]
  197. # Defaults to undef
  198. # [*disable_ssl_validation*]
  199. # Defaults to undef
  200. # [*designate_nameservers*]
  201. # Defaults to undef
  202. # [*manage_tests_packages*]
  203. # Defaults to false
  204. # [*attach_encrypted_volume*]
  205. # Defaults to false
  206. # [*tempest_roles*]
  207. # Should be an array.
  208. # Defaults to $::os_service_default
  209. # [*db_flavor_ref*]
  210. # Valid primary flavor to use in Trove tests.
  211. # Defaults to $::os_service_default
  212. # [*baremetal_driver*]
  213. # Defaults to 'fake'
  214. # [*baremetal_enabled_hardware_types*]
  215. # Defaults to 'ipmi'
  216. # [*ec2api_tester_roles*]
  217. # Defaults to 'Member'
  218. #
  219. # DEPREACTED PARAMETERS
  220. # [*tenant_name*]
  221. # Defaults to undef
  222. # [*alt_tenant_name*]
  223. # Defaults to undef
  224. # [*admin_tenant_name*]
  225. # Defaults to undef
  226. # [*allow_tenant_isolation*]
  227. # Defaults to undef
  228. #
  229. class tempest(
  230. $package_ensure = 'present',
  231. $tempest_workspace = '/var/lib/tempest',
  232. $install_from_source = true,
  233. $git_clone = true,
  234. $tempest_config_file = '/var/lib/tempest/etc/tempest.conf',
  235. # Clone config
  236. #
  237. $tempest_repo_uri = 'git://github.com/openstack/tempest.git',
  238. $tempest_repo_revision = undef,
  239. $tempest_clone_path = '/var/lib/tempest',
  240. $tempest_clone_owner = 'root',
  241. $setup_venv = false,
  242. # Glance image config
  243. #
  244. $configure_images = true,
  245. $image_name = undef,
  246. $image_name_alt = undef,
  247. $glance_v1 = true,
  248. $glance_v2 = true,
  249. # Neutron network config
  250. #
  251. $configure_networks = true,
  252. $public_network_name = undef,
  253. $neutron_api_extensions = undef,
  254. # Horizon dashboard config
  255. $login_url = undef,
  256. $dashboard_url = undef,
  257. $disable_dashboard_ssl_validation = undef,
  258. # tempest.conf parameters
  259. #
  260. $identity_uri = undef,
  261. $identity_uri_v3 = undef,
  262. $cli_dir = undef,
  263. $lock_path = '/var/lib/tempest',
  264. $log_file = $::os_service_default,
  265. $debug = false,
  266. $use_stderr = true,
  267. $use_syslog = false,
  268. $logging_context_format_string = $::os_service_default,
  269. $attach_encrypted_volume = false,
  270. # non admin user
  271. $username = undef,
  272. $password = undef,
  273. $project_name = undef,
  274. # another non-admin user
  275. $alt_username = undef,
  276. $alt_password = undef,
  277. $alt_project_name = undef,
  278. # admin user
  279. $admin_username = undef,
  280. $admin_password = undef,
  281. $admin_project_name = undef,
  282. $admin_role = undef,
  283. $admin_domain_name = undef,
  284. # roles fo the users created by tempest
  285. $tempest_roles = $::os_service_default,
  286. # image information
  287. $image_ref = undef,
  288. $image_ref_alt = undef,
  289. $image_ssh_user = undef,
  290. $image_alt_ssh_user = undef,
  291. $flavor_ref = undef,
  292. $flavor_ref_alt = undef,
  293. $compute_build_interval = undef,
  294. $run_ssh = false,
  295. # whitebox
  296. $whitebox_db_uri = undef,
  297. # testing features that are supported
  298. $resize_available = false,
  299. $change_password_available = undef,
  300. $use_dynamic_credentials = undef,
  301. $l2gw_switch = undef,
  302. # neutron config
  303. $public_network_id = undef,
  304. # Upstream has a bad default - set it to empty string.
  305. $public_router_id = '',
  306. # Sahara config
  307. $sahara_plugins = undef,
  308. # Trove config
  309. $db_flavor_ref = $::os_service_default,
  310. # Service configuration
  311. $cinder_available = true,
  312. $cinder_backup_available = false,
  313. $glance_available = true,
  314. $heat_available = false,
  315. $ceilometer_available = false,
  316. $aodh_available = false,
  317. $gnocchi_available = false,
  318. $panko_available = false,
  319. $designate_available = false,
  320. $horizon_available = true,
  321. $neutron_available = false,
  322. $neutron_bgpvpn_available = false,
  323. $neutron_fwaas_available = true,
  324. $neutron_l2gw_available = false,
  325. $neutron_vpnaas_available = false,
  326. $neutron_dr_available = false,
  327. $nova_available = true,
  328. $murano_available = false,
  329. $sahara_available = false,
  330. $swift_available = false,
  331. $trove_available = false,
  332. $ironic_available = false,
  333. $watcher_available = false,
  334. $zaqar_available = false,
  335. $ec2api_available = false,
  336. $mistral_available = false,
  337. $vitrage_available = false,
  338. $congress_available = false,
  339. $octavia_available = false,
  340. $barbican_available = false,
  341. $keystone_v2 = false,
  342. $keystone_v3 = true,
  343. $auth_version = 'v3',
  344. $run_service_broker_tests = false,
  345. $ca_certificates_file = undef,
  346. $disable_ssl_validation = undef,
  347. $manage_tests_packages = false,
  348. # scenario options
  349. $img_dir = '/var/lib/tempest',
  350. $img_file = 'cirros-0.4.0-x86_64-disk.img',
  351. # designate options
  352. $designate_nameservers = undef,
  353. # ironic options
  354. $baremetal_driver = 'fake',
  355. $baremetal_enabled_hardware_types = 'ipmi',
  356. # ec2api options
  357. $ec2api_tester_roles = ['Member'],
  358. # DEPRECATED PARAMETERS
  359. $tenant_name = undef,
  360. $alt_tenant_name = undef,
  361. $admin_tenant_name = undef,
  362. $allow_tenant_isolation = undef,
  363. ) {
  364. if !is_service_default($tempest_roles) and !empty($tempest_roles){
  365. validate_legacy(Array, 'validate_array', $tempest_roles)
  366. $tempest_roles_real = join($tempest_roles, ',')
  367. } else {
  368. $tempest_roles_real = $::os_service_default
  369. }
  370. if $tenant_name {
  371. warning('The tempest::tenant_name parameter is deprecated, use tempest::project_name instead.')
  372. $project_name_real = $tenant_name
  373. }
  374. else {
  375. $project_name_real = $project_name
  376. }
  377. if $alt_tenant_name {
  378. warning('The tempest::alt_tenant_name parameter is deprecated, use tempest::alt_project_name instead.')
  379. $alt_project_name_real = $alt_tenant_name
  380. }
  381. else {
  382. $alt_project_name_real = $alt_project_name
  383. }
  384. if $admin_tenant_name {
  385. warning('The tempest::admin_tenant_name parameter is deprecated, use tempest::admin_project_name instead.')
  386. $admin_project_name_real = $admin_tenant_name
  387. }
  388. else {
  389. $admin_project_name_real = $admin_project_name
  390. }
  391. if $allow_tenant_isolation {
  392. warning('The tempest::allow_tenant_isolation parameter is deprecated, use tempest::use_dynamic_credentials instead.')
  393. $use_dynamic_credentials_real = $allow_tenant_isolation
  394. }
  395. else {
  396. $use_dynamic_credentials_real = $use_dynamic_credentials
  397. }
  398. include ::tempest::params
  399. include ::openstacklib::openstackclient
  400. if $install_from_source {
  401. $setuptools_pkg = "python${tempest::params::pyvers}-setuptools"
  402. ensure_packages([
  403. 'git',
  404. $setuptools_pkg,
  405. ], { allow_virtual => true })
  406. ensure_packages($tempest::params::dev_packages)
  407. # NOTE(aschultz): Ubuntu setup tools has dropped easy_install since 18.04
  408. # so we install via package now. Though if we hit this, we can only
  409. # install "pip". This likely should just be removed though I'm not sure
  410. # about pip availability for RHEL systems.
  411. exec { 'install-pip':
  412. command => 'easy_install pip',
  413. unless => "which ${tempest::params::pip_command}",
  414. path => ['/bin','/usr/bin','/usr/local/bin'],
  415. require => Package[$setuptools_pkg],
  416. }
  417. exec { 'install-tox':
  418. command => "${tempest::params::pip_command} install -U tox",
  419. unless => 'which tox',
  420. path => ['/bin','/usr/bin','/usr/local/bin'],
  421. require => Exec['install-pip'],
  422. }
  423. if $git_clone {
  424. vcsrepo { $tempest_clone_path:
  425. ensure => 'present',
  426. source => $tempest_repo_uri,
  427. revision => $tempest_repo_revision,
  428. provider => 'git',
  429. require => Package['git'],
  430. user => $tempest_clone_owner,
  431. }
  432. Vcsrepo<||> -> Tempest_config<||>
  433. }
  434. if $setup_venv {
  435. # virtualenv will be installed along with tox
  436. exec { 'setup-venv':
  437. command => join(["virtualenv -p python${tempest::params::pyvers} ${tempest_clone_path}/.venv",
  438. "${tempest_clone_path}/.venv/bin/${tempest::params::pip_command} install -U -r requirements.txt"],
  439. ' && '),
  440. cwd => $tempest_clone_path,
  441. unless => "test -d ${tempest_clone_path}/.venv",
  442. path => ['/bin','/usr/bin','/usr/local/bin'],
  443. require => [
  444. Exec['install-tox'],
  445. Package[$tempest::params::dev_packages],
  446. ],
  447. }
  448. if $git_clone {
  449. Vcsrepo<||> -> Exec['setup-venv']
  450. }
  451. }
  452. $tempest_conf = "${tempest_clone_path}/etc/tempest.conf"
  453. Tempest_config {
  454. path => $tempest_conf,
  455. }
  456. } else {
  457. Tempest_config {
  458. path => $tempest_config_file,
  459. }
  460. }
  461. if ! $install_from_source {
  462. package { 'tempest':
  463. ensure => $package_ensure,
  464. name => $::tempest::params::package_name,
  465. tag => ['openstack', 'tempest-package'],
  466. }
  467. $tempest_conf = "${tempest_workspace}/etc/tempest.conf"
  468. # Create tempest workspace by running tempest init.
  469. # It will generate etc/tempest.conf, logs and tempest_lock folder
  470. # in tempest workspace
  471. exec {'tempest-workspace':
  472. command => "tempest init ${tempest_workspace}",
  473. path => ['/bin', '/usr/bin'],
  474. refreshonly => true,
  475. require => Package['tempest'],
  476. }
  477. Package<| tag == 'tempest-package' |> -> Exec['tempest-workspace']
  478. Package['tempest'] ~> Exec['tempest-workspace']
  479. Exec['tempest-workspace'] -> Tempest_config<||>
  480. }
  481. tempest_config {
  482. 'auth/admin_domain_name': value => $admin_domain_name;
  483. 'auth/admin_password': value => $admin_password, secret => true;
  484. 'auth/admin_project_name': value => $admin_project_name_real;
  485. 'auth/admin_username': value => $admin_username;
  486. 'auth/tempest_roles': value => $tempest_roles_real;
  487. 'auth/use_dynamic_credentials': value => $use_dynamic_credentials_real;
  488. 'compute/change_password_available': value => $change_password_available;
  489. 'compute/flavor_ref': value => $flavor_ref;
  490. 'compute/flavor_ref_alt': value => $flavor_ref_alt;
  491. 'compute/image_alt_ssh_user': value => $image_alt_ssh_user;
  492. 'compute/image_ref': value => $image_ref;
  493. 'compute/image_ref_alt': value => $image_ref_alt;
  494. 'compute/build_interval': value => $compute_build_interval;
  495. 'validation/image_ssh_user': value => $image_ssh_user;
  496. 'validation/run_validation': value => $run_ssh;
  497. 'identity/admin_role': value => $admin_role;
  498. 'identity/alt_password': value => $alt_password, secret => true;
  499. 'identity/alt_project_name': value => $alt_project_name_real;
  500. 'identity/alt_username': value => $alt_username;
  501. 'identity/password': value => $password, secret => true;
  502. 'identity/project_name': value => $project_name_real;
  503. 'identity/uri': value => $identity_uri;
  504. 'identity/uri_v3': value => $identity_uri_v3;
  505. 'identity/username': value => $username;
  506. 'identity/auth_version': value => $auth_version;
  507. 'identity/ca_certificates_file': value => $ca_certificates_file;
  508. 'identity/disable_ssl_certificate_validation': value => $disable_ssl_validation;
  509. 'identity-feature-enabled/api_v2': value => $keystone_v2;
  510. 'identity-feature-enabled/api_v3': value => $keystone_v3;
  511. 'image-feature-enabled/api_v1': value => $glance_v1;
  512. 'image-feature-enabled/api_v2': value => $glance_v2;
  513. 'l2gw/l2gw_switch': value => $l2gw_switch;
  514. 'network-feature-enabled/api_extensions': value => $neutron_api_extensions;
  515. 'network/public_network_id': value => $public_network_id;
  516. 'network/public_router_id': value => $public_router_id;
  517. 'dashboard/login_url': value => $login_url;
  518. 'dashboard/dashboard_url': value => $dashboard_url;
  519. 'dashboard/disable_ssl_certificate_validation': value => $disable_dashboard_ssl_validation;
  520. 'database/db_flavor_ref': value => $db_flavor_ref;
  521. 'service_available/cinder': value => $cinder_available;
  522. 'volume-feature-enabled/backup': value => $cinder_backup_available;
  523. 'service_available/glance': value => $glance_available;
  524. 'service_available/heat': value => $heat_available;
  525. 'service_available/ceilometer': value => $ceilometer_available;
  526. 'service_available/aodh': value => $aodh_available;
  527. # https://bugs.launchpad.net/aodh/+bug/1611406
  528. 'service_available/aodh_plugin': value => $aodh_available;
  529. 'service_available/barbican': value => $barbican_available;
  530. 'service_available/bgpvpn': value => $neutron_bgpvpn_available;
  531. 'service_available/gnocchi': value => $gnocchi_available;
  532. 'service_available/panko': value => $panko_available;
  533. 'service_available/designate': value => $designate_available;
  534. 'service_available/horizon': value => $horizon_available;
  535. 'service_available/l2gw': value => $neutron_l2gw_available;
  536. 'service_available/neutron': value => $neutron_available;
  537. 'service_available/mistral': value => $mistral_available;
  538. 'service_available/vitrage': value => $vitrage_available;
  539. 'service_available/nova': value => $nova_available;
  540. 'service_available/murano': value => $murano_available;
  541. 'service_available/sahara': value => $sahara_available;
  542. 'service_available/swift': value => $swift_available;
  543. 'service_available/trove': value => $trove_available;
  544. 'service_available/ironic': value => $ironic_available;
  545. 'service_available/watcher': value => $watcher_available;
  546. 'service_available/zaqar': value => $zaqar_available;
  547. 'service_available/ec2api': value => $ec2api_available;
  548. 'service_available/congress': value => $congress_available;
  549. 'service_available/octavia': value => $octavia_available;
  550. 'whitebox/db_uri': value => $whitebox_db_uri;
  551. 'cli/cli_dir': value => $cli_dir;
  552. 'scenario/img_dir': value => $img_dir;
  553. 'scenario/img_file': value => $img_file;
  554. 'service_broker/run_service_broker_tests': value => $run_service_broker_tests;
  555. 'dns/nameservers': value => $designate_nameservers;
  556. 'compute-feature-enabled/attach_encrypted_volume': value => $attach_encrypted_volume;
  557. 'compute-feature-enabled/resize': value => $resize_available;
  558. 'baremetal/driver': value => $baremetal_driver;
  559. 'baremetal/enabled_hardware_types': value => $baremetal_enabled_hardware_types;
  560. }
  561. oslo::concurrency { 'tempest_config': lock_path => $lock_path }
  562. oslo::log { 'tempest_config':
  563. debug => $debug,
  564. log_file => $log_file,
  565. use_stderr => $use_stderr,
  566. use_syslog => $use_syslog,
  567. logging_context_format_string => $logging_context_format_string
  568. }
  569. if $manage_tests_packages {
  570. if ($aodh_available or $ceilometer_available or $panko_available or $gnocchi_available) and $::tempest::params::python_telemetry_tests {
  571. package { 'python-telemetry-tests':
  572. ensure => present,
  573. name => $::tempest::params::python_telemetry_tests,
  574. tag => ['openstack', 'tempest-package'],
  575. }
  576. }
  577. if $cinder_available and $::tempest::params::python_cinder_tests {
  578. package { 'python-cinder-tests':
  579. ensure => present,
  580. name => $::tempest::params::python_cinder_tests,
  581. tag => ['openstack', 'tempest-package'],
  582. }
  583. }
  584. if $glance_available and $::tempest::params::python_glance_tests {
  585. package { 'python-glance-tests':
  586. ensure => present,
  587. name => $::tempest::params::python_glance_tests,
  588. tag => ['openstack', 'tempest-package'],
  589. }
  590. }
  591. if $heat_available and $::tempest::params::python_heat_tests {
  592. package { 'python-heat-tests':
  593. ensure => present,
  594. name => $::tempest::params::python_heat_tests,
  595. tag => ['openstack', 'tempest-package'],
  596. }
  597. }
  598. if $ironic_available and $::tempest::params::python_ironic_tests {
  599. package { 'python-ironic-tests':
  600. ensure => present,
  601. name => $::tempest::params::python_ironic_tests,
  602. tag => ['openstack', 'tempest-package'],
  603. }
  604. }
  605. if $::tempest::params::python_keystone_tests {
  606. package { 'python-keystone-tests':
  607. ensure => present,
  608. name => $::tempest::params::python_keystone_tests,
  609. tag => ['openstack', 'tempest-package'],
  610. }
  611. }
  612. if $murano_available and $::tempest::params::python_murano_tests {
  613. package { 'python-murano-tests':
  614. ensure => present,
  615. name => $::tempest::params::python_murano_tests,
  616. tag => ['openstack', 'tempest-package'],
  617. }
  618. }
  619. if $neutron_available and $::tempest::params::python_neutron_tests {
  620. package { 'python-neutron-tests':
  621. ensure => present,
  622. name => $::tempest::params::python_neutron_tests,
  623. tag => ['openstack', 'tempest-package'],
  624. }
  625. if $neutron_fwaas_available {
  626. package { 'python-neutron-fwaas-tests':
  627. ensure => present,
  628. name => $::tempest::params::python_fwaas_tests,
  629. tag => ['openstack', 'tempest-package'],
  630. }
  631. }
  632. if $neutron_l2gw_available and $::tempest::params::python_l2gw_tests {
  633. package { 'python-networking-l2gw-tests-tempest':
  634. ensure => present,
  635. name => $::tempest::params::python_l2gw_tests,
  636. tag => ['openstack', 'tempest-package'],
  637. }
  638. }
  639. if $neutron_vpnaas_available {
  640. package { 'python-neutron-vpnaas-tests':
  641. ensure => present,
  642. name => $::tempest::params::python_vpnaas_tests,
  643. tag => ['openstack', 'tempest-package'],
  644. }
  645. }
  646. if $neutron_dr_available and $::tempest::params::python_dr_tests {
  647. package { 'python-neutron-dynamic-routing-tests':
  648. ensure => present,
  649. name => $::tempest::params::python_dr_tests,
  650. tag => ['openstack', 'tempest-package'],
  651. }
  652. }
  653. }
  654. if $nova_available and $::tempest::params::python_nova_tests {
  655. package { 'python-nova-tests':
  656. ensure => present,
  657. name => $::tempest::params::python_nova_tests,
  658. tag => ['openstack', 'tempest-package'],
  659. }
  660. }
  661. if $sahara_available and $::tempest::params::python_sahara_tests {
  662. package { 'python-sahara-tests-tempest':
  663. ensure => present,
  664. name => $::tempest::params::python_sahara_tests,
  665. tag => ['openstack', 'tempest-package'],
  666. }
  667. }
  668. if $swift_available and $::tempest::params::python_swift_tests {
  669. package { 'python-swift-tests':
  670. ensure => present,
  671. name => $::tempest::params::python_swift_tests,
  672. tag => ['openstack', 'tempest-package'],
  673. }
  674. }
  675. if $trove_available and $::tempest::params::python_trove_tests {
  676. package { 'python-trove-tests':
  677. ensure => present,
  678. name => $::tempest::params::python_trove_tests,
  679. tag => ['openstack', 'tempest-package'],
  680. }
  681. }
  682. if $watcher_available and $::tempest::params::python_watcher_tests {
  683. package { 'python-watcher-tests-tempest':
  684. ensure => present,
  685. name => $::tempest::params::python_watcher_tests,
  686. tag => ['openstack', 'tempest-package'],
  687. }
  688. }
  689. if $zaqar_available and $::tempest::params::python_zaqar_tests {
  690. package { 'python-zaqar-tests':
  691. ensure => present,
  692. name => $::tempest::params::python_zaqar_tests,
  693. tag => ['openstack', 'tempest-package'],
  694. }
  695. }
  696. if $congress_available and $::tempest::params::congress_congress_tests {
  697. package { 'python-congress-tests':
  698. ensure => present,
  699. name => $::tempest::params::python_congress_tests,
  700. tag => ['openstack', 'tempest-package'],
  701. }
  702. }
  703. if $mistral_available and $::tempest::params::python_mistral_tests {
  704. package { 'python-mistral-tests':
  705. ensure => present,
  706. name => $::tempest::params::python_mistral_tests,
  707. tag => ['openstack', 'tempest-package'],
  708. }
  709. }
  710. if $vitrage_available and $::tempest::params::python_vitrage_tests {
  711. package { 'python-vitrage-tests':
  712. ensure => present,
  713. name => $::tempest::params::python_vitrage_tests,
  714. tag => ['openstack', 'tempest-package'],
  715. }
  716. }
  717. if $designate_available and $::tempest::params::python_designate_tests {
  718. package { 'python-designate-tests':
  719. ensure => present,
  720. name => $::tempest::params::python_designate_tests,
  721. tag => ['openstack', 'tempest-package'],
  722. }
  723. }
  724. if $horizon_available and $::tempest::params::python_horizon_tests {
  725. package { 'python-horizon-tests':
  726. ensure => present,
  727. name => $::tempest::params::python_horizon_tests,
  728. tag => ['openstack', 'tempest-package'],
  729. }
  730. }
  731. if $octavia_available and $::tempest::params::python_octavia_tests {
  732. package { 'python-octavia-tests':
  733. ensure => present,
  734. name => $::tempest::params::python_octavia_tests,
  735. tag => ['openstack', 'tempest-package'],
  736. }
  737. }
  738. if $ec2api_available and $::tempest::params::python_ec2api_tests {
  739. package { 'python-ec2-api-tests':
  740. ensure => present,
  741. name => $::tempest::params::python_ec2api_tests,
  742. tag => ['openstack', 'tempest-package'],
  743. }
  744. }
  745. if $barbican_available and $::tempest::params::python_barbican_tests {
  746. package { 'python-barbican-tests-tempest':
  747. ensure => present,
  748. name => $::tempest::params::python_barbican_tests,
  749. tag => ['openstack', 'tempest-package'],
  750. }
  751. }
  752. }
  753. if $configure_images {
  754. if ! $image_ref and $image_name {
  755. # If the image id was not provided, look it up via the image name
  756. # and set the value in the conf file.
  757. tempest_glance_id_setter { 'image_ref':
  758. ensure => present,
  759. tempest_conf_path => $tempest_conf,
  760. image_name => $image_name,
  761. }
  762. Glance_image<||> -> Tempest_glance_id_setter['image_ref']
  763. Tempest_config<||> -> Tempest_glance_id_setter['image_ref']
  764. Keystone_user_role<||> -> Tempest_glance_id_setter['image_ref']
  765. } elsif ($image_name and $image_ref) or (! $image_name and ! $image_ref) {
  766. fail('A value for either image_name or image_ref must be provided.')
  767. }
  768. if ! $image_ref_alt and $image_name_alt {
  769. tempest_glance_id_setter { 'image_ref_alt':
  770. ensure => present,
  771. tempest_conf_path => $tempest_conf,
  772. image_name => $image_name_alt,
  773. }
  774. Glance_image<||> -> Tempest_glance_id_setter['image_ref_alt']
  775. Tempest_config<||> -> Tempest_glance_id_setter['image_ref_alt']
  776. Keystone_user_role<||> -> Tempest_glance_id_setter['image_ref_alt']
  777. } elsif ($image_name_alt and $image_ref_alt) or (! $image_name_alt and ! $image_ref_alt) {
  778. fail('A value for either image_name_alt or image_ref_alt must \
  779. be provided.')
  780. }
  781. }
  782. if $neutron_available and $configure_networks {
  783. if ! $public_network_id and $public_network_name {
  784. tempest_neutron_net_id_setter { 'public_network_id':
  785. ensure => present,
  786. tempest_conf_path => $tempest_conf,
  787. network_name => $public_network_name,
  788. }
  789. Neutron_network<||> -> Tempest_neutron_net_id_setter['public_network_id']
  790. Tempest_config<||> -> Tempest_neutron_net_id_setter['public_network_id']
  791. Keystone_user_role<||> -> Tempest_neutron_net_id_setter['public_network_id']
  792. } elsif ($public_network_name and $public_network_id) or (! $public_network_name and ! $public_network_id) {
  793. fail('A value for either public_network_id or public_network_name \
  794. must be provided.')
  795. }
  796. }
  797. if $sahara_available {
  798. tempest_config {
  799. 'data-processing-feature-enabled/plugins': value => $sahara_plugins,
  800. }
  801. }
  802. if $ec2api_available {
  803. tempest_config {
  804. 'aws/instance_type': value => $flavor_ref;
  805. 'aws/instance_type_alt': value => $flavor_ref_alt;
  806. }
  807. keystone_user { 'ec2api-tester' :
  808. ensure => present,
  809. enabled => true,
  810. }
  811. keystone_user_role { 'ec2api-tester@openstack' :
  812. ensure => present,
  813. roles => $ec2api_tester_roles,
  814. }
  815. tempest_ec2_credentials { 'ec2_test_creds':
  816. ensure => present,
  817. tempest_conf_path => $tempest_conf,
  818. user => 'ec2api-tester',
  819. project => 'openstack',
  820. }
  821. Tempest_config<||> -> Tempest_ec2_credentials['ec2_test_creds']
  822. Keystone_user_role<||> -> Tempest_ec2_credentials['ec2_test_creds']
  823. }
  824. }