Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to Puppet 4 types #159

Merged
merged 1 commit into from
Aug 21, 2017
Merged

Refactor to Puppet 4 types #159

merged 1 commit into from
Aug 21, 2017

Conversation

sean797
Copy link
Member

@sean797 sean797 commented Jun 15, 2017

No description provided.

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

@ekohl this looks good to me, your thoughts? Also @sean797 can you do a rebase there are conflicts now.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

It looks like I had a draft review that I didn't submit. Could you rebase? I'd like to get this in for 3.5.

Boolean $regenerate_ca = $::certs::params::regenerate_ca,
Boolean $deploy = $::certs::params::deploy,
String $ca_common_name = $::certs::params::ca_common_name,
String[2] $country = $::certs::params::country,
Copy link
Member

@ekohl ekohl Jun 15, 2017

Choose a reason for hiding this comment

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

If it needs to be exactly 2 then I think it needs to be String[2,2]

@sean797
Copy link
Member Author

sean797 commented Jul 26, 2017

Updated, thanks @chris1984 & @ekohl

validate_absolute_path($server_cert)
validate_absolute_path($server_cert_req)
validate_absolute_path($server_key)
validate_absolute_path($server_ca_cert)
validate_file_exists($server_cert, $server_cert_req, $server_key, $server_ca_cert)
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, but this is the only reason we still need puppet-common. I'm wondering if we can get rid of it somehow.

@ekohl
Copy link
Member

ekohl commented Jul 26, 2017

Tests are broken due to facter. Katello/foreman-installer-modulesync#29 should fix it.

@ekohl
Copy link
Member

ekohl commented Jul 26, 2017

Since I'm currently in a hotel I don't have access to my testing infrastructure. Anyone can run this through the forklift pipeline and verify it still works?

@ekohl
Copy link
Member

ekohl commented Aug 9, 2017

Running this with the pipeline fails:

1..2
ok 1 check hammer ping
ok 2 check katello-service status
1..32
ok 1 Create an Empty Organization
ok 2 create an Organization
ok 3 create a product
ok 4 create package repository
not ok 5 upload package
# (in test file fb-content-katello.bats, line 41)
#   `--product="${PRODUCT}" --name="${YUM_REPOSITORY}" --path="/tmp/animaniacs-0.1-1.noarch.rpm" | grep -q "Successfully uploaded"' failed
# --2017-08-09 22:06:40--  https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/test_errata_install/animaniacs-0.1-1.noarch.rpm
# Resolving repos.fedorapeople.org (repos.fedorapeople.org)... 152.19.134.199, 2610:28:3090:3001:5054:ff:fea7:9474
# Connecting to repos.fedorapeople.org (repos.fedorapeople.org)|152.19.134.199|:443... connected.
# HTTP request sent, awaiting response... 200 OK
# Length: 4361 (4,3K) [application/x-rpm]
# Saving to: ‘/tmp/animaniacs-0.1-1.noarch.rpm’
# 
#      0K ....                                                  100%  198M=0s
# 
# 2017-08-09 22:06:41 (198 MB/s) - ‘/tmp/animaniacs-0.1-1.noarch.rpm’ saved [4361/4361]
# 
# warning: Overriding "Content-Type" header "multipart/form-data" with "multipart/form-data; boundary=----RubyFormBoundaryDimFcDS69XuTK6sh" due to payload
# Failed to upload file 'animaniacs-0.1-1.noarch.rpm' to repository. Please check the file and try again.
not ok 6 sync repository
# (in test file fb-content-katello.bats, line 45)
#   `hammer repository synchronize --organization="${ORGANIZATION}" \' failed with status 70
# Could not synchronize the repository:
#   Required lock is already taken by other running tasks.
#   Please inspect their state, fix their errors and resume them.
#   
#   Required lock: read
#   Conflicts with tasks:
#   - https://pipeline-katello-nightly-centos7.donald.example.com/foreman_tasks/tasks/3dfb7033-d947-423f-a322-b4f8e1bb2bca
ok 7 create puppet repository
not ok 8 upload puppet module
# (in test file fb-content-katello.bats, line 58)
#   `--path="/tmp/stbenjam-dummy-0.2.0.tar.gz" | grep -q "Successfully uploaded"' failed
#   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#                                  Dload  Upload   Total   Spent    Left  Speed
100  2059    0  2059    0     0   2420      0 --:--:-- --:--:-- --:--:--  2419
# warning: Overriding "Content-Type" header "multipart/form-data" with "multipart/form-data; boundary=----RubyFormBoundaryZgfyqFmW0d8eHktO" due to payload
# Failed to upload file 'stbenjam-dummy-0.2.0.tar.gz' to repository. Please check the file and try again.
ok 9 create lifecycle environment
ok 10 create content view
ok 11 add repo to content view
not ok 12 publish content view
# (in test file fb-content-katello.bats, line 193)
#   `hammer content-view publish --organization="${ORGANIZATION}" \' failed with status 70
# Could not publish the content view:
#   Required lock is already taken by other running tasks.
#   Please inspect their state, fix their errors and resume them.
#   
#   Required lock: read
#   Conflicts with tasks:
#   - https://pipeline-katello-nightly-centos7.donald.example.com/foreman_tasks/tasks/deb11429-e18a-46bd-a018-0cab6ef91de5
not ok 13 promote content view
# (in test file fb-content-katello.bats, line 198)
#   `hammer content-view version promote  --organization="${ORGANIZATION}" \' failed with status 70
# Could not promote the content view:
#   Error: content_view_version not found
not ok 14 create activation key
# (in test file fb-content-katello.bats, line 91)
#   `--unlimited-hosts | grep -q "Activation key created"' failed
# Could not create the activation key:
#   Validation failed: Content view 'Test CV' is not in environment 'Test'
not ok 15 disable auto-attach
# (in test file fb-content-katello.bats, line 95)
#   `hammer activation-key update --organization="${ORGANIZATION}" \' failed with status 70
# Could not update the activation key:
#   Error: activation_key not found
not ok 16 add subscription to activation key
# (in test file fb-content-katello.bats, line 102)
#   `--name="${ACTIVATION_KEY}" | grep ID | tr -d ' ' | cut -d':' -f2)' failed
# Error: activation_key not found
ok 17 install subscription manager
not ok 18 register subscription manager
# (in test file fb-content-katello.bats, line 138)
#   `subscription-manager list --consumed | grep "${PRODUCT}"' failed
# rc=0
# Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
#               : manager
# This system is not registered with Subscription Management. You can use subscription-manager to register.
# No Match for argument: katello-ca-consumer-*
# No Packages marked for removal
# rc=0
# Retrieving http://localhost/pub/katello-ca-consumer-latest.noarch.rpm
# Preparing...                          ########################################
# Updating / installing...
# katello-ca-consumer-pipeline-katello-n########################################
# rc=70
# Couldn't find activation key 'Test AK'
not ok 19 check content host is registered
# (in test file fb-content-katello.bats, line 142)
#   `hammer host info --name $(hostname -f)' failed with status 70
# Error: host not found
not ok 20 enable content view repo
# (in test file fb-content-katello.bats, line 146)
#   `subscription-manager repos --enable="${ORGANIZATION_LABEL}_${PRODUCT_LABEL}_${YUM_REPOSITORY_LABEL}" | grep -q "is enabled for this system"' failed
ok 21 install katello-host-tools
not ok 22 install package locally
# (from function `tIsRedHatCompatible' in file os_helper.bash, line 4,
#  from function `tPackageInstall' in file os_helper.bash, line 89,
#  in test file fb-content-katello.bats, line 155)
#   `tPackageInstall walrus-0.71 && tPackageExists walrus-0.71' failed
# Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id,
#               : search-disabled-repos, subscription-manager, tracer_upload
# This system is not registered with Subscription Management. You can use subscription-manager to register.
# Loading mirror speeds from cached hostfile
#  * base: nl.mirror.babylon.network
#  * epel: mirror.daniel-jost.net
#  * extras: nl.mirror.babylon.network
#  * updates: nl.mirror.babylon.network
# No package walrus-0.71 available.
# Error: Nothing to do
# Uploading Enabled Reposistories Report
# Loaded plugins: fastestmirror, product-id
# Cannot upload enabled repos report, is this client registered?
not ok 23 check available errata
# (in test file fb-content-katello.bats, line 160)
#   `hammer host errata list --host $(hostname -f) | grep 'RHEA-2012:0055'' failed
# Error: host not found
ok 24 install katello-agent
ok 25 30 sec of sleep for groggy gofers
not ok 26 install package remotely (katello-agent)
# (from function `tPackageExists' in file os_helper.bash, line 80,
#  in test file fb-content-katello.bats, line 175)
#   `tPackageExists gorilla' failed
# Could not install packages:
#   Error: host not found
not ok 27 install errata remotely (katello-agent)
# (from function `tPackageExists' in file os_helper.bash, line 80,
#  in test file fb-content-katello.bats, line 181)
#   `tPackageExists walrus-5.21' failed
# Could not apply errata:
#   Error: host not found
not ok 28 add puppet module to content view
# (in test file fb-content-katello.bats, line 187)
#   `module_id=$(hammer puppet-module list --repository-id=$repo_id | grep dummy | cut -d\| -f1)' failed
not ok 29 publish content view
# (in test file fb-content-katello.bats, line 193)
#   `hammer content-view publish --organization="${ORGANIZATION}" \' failed with status 70
# Could not publish the content view:
#   Required lock is already taken by other running tasks.
#   Please inspect their state, fix their errors and resume them.
#   
#   Required lock: read
#   Conflicts with tasks:
#   - https://pipeline-katello-nightly-centos7.donald.example.com/foreman_tasks/tasks/deb11429-e18a-46bd-a018-0cab6ef91de5
not ok 30 promote content view
# (in test file fb-content-katello.bats, line 198)
#   `hammer content-view version promote  --organization="${ORGANIZATION}" \' failed with status 70
# Could not promote the content view:
#   Error: content_view_version not found
ok 31 # skip add puppetclass to host
ok 32 # skip puppet run applies dummy module
1..4
ok 1 proxy is registered
ok 2 enable lifecycle environment for proxy
ok 3 sync proxy
not ok 4 content is available from proxy
# (in test file fb-proxy.bats, line 32)
#   `wget $URL1 -P /tmp || wget $URL2 -P /tmp' failed with status 8
# --2017-08-09 22:09:32--  http://pipeline-proxy-nightly-centos7.donald.example.com/pulp/repos/Test_Organization/Library/Test_CV/custom/Test_Product/Zoo/walrus-0.71-1.noarch.rpm
# Resolving pipeline-proxy-nightly-centos7.donald.example.com (pipeline-proxy-nightly-centos7.donald.example.com)... 192.168.121.2, 192.168.121.2
# Connecting to pipeline-proxy-nightly-centos7.donald.example.com (pipeline-proxy-nightly-centos7.donald.example.com)|192.168.121.2|:80... connected.
# HTTP request sent, awaiting response... 404 NOT FOUND
# 2017-08-09 22:09:32 ERROR 404: NOT FOUND.
# 
# --2017-08-09 22:09:32--  http://pipeline-proxy-nightly-centos7.donald.example.com/pulp/repos/Test_Organization/Library/Test_CV/custom/Test_Product/Zoo/Packages/w/walrus-0.71-1.noarch.rpm
# Resolving pipeline-proxy-nightly-centos7.donald.example.com (pipeline-proxy-nightly-centos7.donald.example.com)... 192.168.121.2, 192.168.121.2
# Connecting to pipeline-proxy-nightly-centos7.donald.example.com (pipeline-proxy-nightly-centos7.donald.example.com)|192.168.121.2|:80... connected.
# HTTP request sent, awaiting response... 404 NOT FOUND
# 2017-08-09 22:09:33 ERROR 404: NOT FOUND.
# 
1..1
not ok 1 Delete an Organization
# (in test file fb-destroy-organization.bats, line 15)
#   `hammer organization delete --name="${ORGANIZATION}"' failed with status 70
# Could not delete the organization:
#   Required lock is already taken by other running tasks.
#   Please inspect their state, fix their errors and resume them.
#   
#   Required lock: read
#   Conflicts with tasks:
#   - https://pipeline-katello-nightly-centos7.donald.example.com/foreman_tasks/tasks/ad469afa-198f-4ef5-8ec0-a3b3987ce614
1..1
ok 1 collect important logs

@sean797
Copy link
Member Author

sean797 commented Aug 12, 2017

@ekohl I'm getting that with & without this PR. I guess it isn't related, as task conflict would be a weird symptom of this change anyway. I haven't had a chance to looks into why its failing yet.

@ekohl
Copy link
Member

ekohl commented Aug 12, 2017

You're right that's a weird side effect of this patch. You'd either expect a compilation failure due to an incorrect type than a subtle failure somewhere.

@ekohl
Copy link
Member

ekohl commented Aug 18, 2017

Since we have green nightlies again I was able to retest and it all passed so 👍

@ekohl ekohl merged commit 95136ba into theforeman:master Aug 21, 2017
@ekohl
Copy link
Member

ekohl commented Aug 21, 2017

Thanks @sean797!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants