22
33source experiment/run-library.sh
44
5+ organization=" ${PARAM_organization:- Default Organization} "
56manifest=" ${PARAM_manifest:- conf/ contperf/ manifest.zip} "
67inventory=" ${PARAM_inventory:- conf/ contperf/ inventory.ini} "
78private_key=" ${PARAM_private_key:- conf/ contperf/ id_rsa_perf} "
@@ -28,7 +29,6 @@ job_name="${PARAM_job_name:-Sat_Experiment}"
2829max_age_input=" ${PARAM_max_age_input:- 19000} "
2930skip_down_setup=" ${PARAM_skip_down_setup:- false} "
3031
31- do=" Default Organization"
3232dl=" Default Location"
3333
3434opts=" --forks 100 -i $inventory --private-key $private_key "
@@ -41,68 +41,70 @@ generic_environment_check
4141# If we already have setup ready - all repos synced, etc we can skip directly to registering and downloading batches. PLEASE DELETE ALL HOSTS FROM SATELLITE.
4242if [ " $skip_down_setup " != " true" ]; then
4343 section " Upload manifest"
44- h regs-10-ensure-loc-in-org.log " organization add-location --name 'Default Organization' --location 'Default Location'"
44+ h_out " --no-headers --csv organization list --fields name" | grep --quiet ' ^$organization$' \
45+ || h regs-10-ensure-org.log " organization create --name '$organization '"
46+ h regs-10-ensure-loc-in-org.log " organization add-location --name '$organization ' --location '$dl '"
4547 a regs-10-manifest-deploy.log -m copy -a " src=$manifest dest=/root/manifest-auto.zip force=yes" satellite6
46- h regs-10-manifest-upload.log " subscription upload --file '/root/manifest-auto.zip' --organization '$do '"
48+ h regs-10-manifest-upload.log " subscription upload --file '/root/manifest-auto.zip' --organization '$organization '"
4749 s $wait_interval
4850
4951
5052 section " Sync from CDN" # do not measure because of unpredictable network latency
51- h regs-20-set-cdn-stage.log " organization update --name 'Default Organization ' --redhat-repository-url '$cdn_url_full '"
52- h regs-20-reposet-enable-rhel7.log " repository-set enable --organization '$do ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server (RPMs)' --releasever '7Server' --basearch 'x86_64'"
53- h regs-20-repo-immediate-rhel7.log " repository update --organization '$do ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server' --download-policy 'immediate'"
54- h regs-20-repo-sync-rhel7.log " repository synchronize --organization '$do ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server'"
53+ h regs-20-set-cdn-stage.log " organization update --name '$organization ' --redhat-repository-url '$cdn_url_full '"
54+ h regs-20-reposet-enable-rhel7.log " repository-set enable --organization '$organization ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server (RPMs)' --releasever '7Server' --basearch 'x86_64'"
55+ h regs-20-repo-immediate-rhel7.log " repository update --organization '$organization ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server' --download-policy 'immediate'"
56+ h regs-20-repo-sync-rhel7.log " repository synchronize --organization '$organization ' --product 'Red Hat Enterprise Linux Server' --name 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server'"
5557 s $wait_interval
5658
5759
5860 section " Sync Tools repo" # do not measure because of unpredictable network latency
59- h regs-30-sat-tools-product-create.log " product create --organization '$do ' --name SatToolsProduct"
60- h regs-30-repository-create-sat-tools.log " repository create --organization '$do ' --product SatToolsProduct --name SatToolsRepo --content-type yum --url '$repo_sat_tools '"
61- h regs-30-repository-sync-sat-tools.log " repository synchronize --organization '$do ' --product SatToolsProduct --name SatToolsRepo"
61+ h regs-30-sat-tools-product-create.log " product create --organization '$organization ' --name SatToolsProduct"
62+ h regs-30-repository-create-sat-tools.log " repository create --organization '$organization ' --product SatToolsProduct --name SatToolsRepo --content-type yum --url '$repo_sat_tools '"
63+ h regs-30-repository-sync-sat-tools.log " repository synchronize --organization '$organization ' --product SatToolsProduct --name SatToolsRepo"
6264 s $wait_interval
6365
6466 section " Sync Client repos" # do not measure because of unpredictable network latency
65- h regs-30-sat-client-product-create.log " product create --organization '$do ' --name SatClientProduct"
66- h regs-30-repository-create-sat-client_7.log " repository create --organization '$do ' --product SatClientProduct --name SatClient7Repo --content-type yum --url '$repo_sat_client_7 '"
67- h regs-30-repository-sync-sat-client_7.log " repository synchronize --organization '$do ' --product SatClientProduct --name SatClient7Repo"
67+ h regs-30-sat-client-product-create.log " product create --organization '$organization ' --name SatClientProduct"
68+ h regs-30-repository-create-sat-client_7.log " repository create --organization '$organization ' --product SatClientProduct --name SatClient7Repo --content-type yum --url '$repo_sat_client_7 '"
69+ h regs-30-repository-sync-sat-client_7.log " repository synchronize --organization '$organization ' --product SatClientProduct --name SatClient7Repo"
6870 s $wait_interval
69- h regs-30-repository-create-sat-client_8.log " repository create --organization '$do ' --product SatClientProduct --name SatClient8Repo --content-type yum --url '$repo_sat_client_8 '"
70- h regs-30-repository-sync-sat-client_8.log " repository synchronize --organization '$do ' --product SatClientProduct --name SatClient8Repo"
71+ h regs-30-repository-create-sat-client_8.log " repository create --organization '$organization ' --product SatClientProduct --name SatClient8Repo --content-type yum --url '$repo_sat_client_8 '"
72+ h regs-30-repository-sync-sat-client_8.log " repository synchronize --organization '$organization ' --product SatClientProduct --name SatClient8Repo"
7173 s $wait_interval
7274
7375 section " Sync Download Test repo"
74- # h product-create-downtest.log "product create --organization '$do ' --name DownTestProduct"
76+ # h product-create-downtest.log "product create --organization '$organization ' --name DownTestProduct"
7577 ap repository-create-downtest.log playbooks/tests/downloadtest-syncrepo.yaml -e " repo_download_test=$repo_download_test repo_count_download_test=$repo_count_download_test "
76- # h repository-create-downtest.log "repository create --organization '$do ' --product DownTestProduct --name DownTestRepo --content-type yum --url '$repo_download_test'"
77- # h repo-sync-downtest.log "repository synchronize --organization '$do ' --product DownTestProduct --name DownTestRepo"
78+ # h repository-create-downtest.log "repository create --organization '$organization ' --product DownTestProduct --name DownTestRepo --content-type yum --url '$repo_download_test'"
79+ # h repo-sync-downtest.log "repository synchronize --organization '$organization ' --product DownTestProduct --name DownTestRepo"
7880 s $wait_interval
7981
8082 section " Prepare for registrations"
8183 ap regs-40-recreate-client-scripts.log playbooks/satellite/client-scripts.yaml -e " registration_hostgroup=hostgroup-for-{{ tests_registration_target }}" # this detects OS, so need to run after we synces one
8284
8385 h_out " --no-headers --csv domain list --search 'name = {{ containers_domain }}'" | grep --quiet ' ^[0-9]\+,' \
84- || h regs-40-domain-create.log " domain create --name '{{ containers_domain }}' --organizations '$do '"
86+ || h regs-40-domain-create.log " domain create --name '{{ containers_domain }}' --organizations '$organization '"
8587 tmp=$( mktemp )
86- h_out " --no-headers --csv location list --organization '$do '" | grep ' ^[0-9]\+,' > $tmp
88+ h_out " --no-headers --csv location list --organization '$organization '" | grep ' ^[0-9]\+,' > $tmp
8789 location_ids=$( cut -d ' ,' -f 1 $tmp | tr ' \n' ' ,' | sed ' s/,$//' )
88- h regs-40-domain-update.log " domain update --name '{{ containers_domain }}' --organizations '$do ' --location-ids '$location_ids '"
90+ h regs-40-domain-update.log " domain update --name '{{ containers_domain }}' --organizations '$organization ' --location-ids '$location_ids '"
8991
90- h regs-40-ak-create.log " activation-key create --content-view '$do View' --lifecycle-environment Library --name ActivationKey --organization '$do '"
91- h_out " --csv subscription list --organization '$do ' --search 'name = SatToolsProduct'" > $logs /subs-list-tools.log
92+ h regs-40-ak-create.log " activation-key create --content-view '$organization View' --lifecycle-environment Library --name ActivationKey --organization '$organization '"
93+ h_out " --csv subscription list --organization '$organization ' --search 'name = SatToolsProduct'" > $logs /subs-list-tools.log
9294 tools_subs_id=$( tail -n 1 $logs /subs-list-tools.log | cut -d ' ,' -f 1 )
93- skip_measurement=' true' h 43-ak-add-subs-tools.log " activation-key add-subscription --organization '$do ' --name ActivationKey --subscription-id '$tools_subs_id '"
94- h_out " --csv subscription list --organization '$do ' --search 'name = \" $rhel_subscription \" '" > $logs /subs-list-rhel.log
95+ skip_measurement=' true' h 43-ak-add-subs-tools.log " activation-key add-subscription --organization '$organization ' --name ActivationKey --subscription-id '$tools_subs_id '"
96+ h_out " --csv subscription list --organization '$organization ' --search 'name = \" $rhel_subscription \" '" > $logs /subs-list-rhel.log
9597 rhel_subs_id=$( tail -n 1 $logs /subs-list-rhel.log | cut -d ' ,' -f 1 )
96- skip_measurement=' true' h 43-ak-add-subs-rhel.log " activation-key add-subscription --organization '$do ' --name ActivationKey --subscription-id '$rhel_subs_id '"
97- h_out " --csv subscription list --organization '$do ' --search 'name = SatClientProduct'" > $logs /subs-list-client.log
98+ skip_measurement=' true' h 43-ak-add-subs-rhel.log " activation-key add-subscription --organization '$organization ' --name ActivationKey --subscription-id '$rhel_subs_id '"
99+ h_out " --csv subscription list --organization '$organization ' --search 'name = SatClientProduct'" > $logs /subs-list-client.log
98100 client_subs_id=$( tail -n 1 $logs /subs-list-client.log | cut -d ' ,' -f 1 )
99- skip_measurement=' true' h 43-ak-add-subs-client.log " activation-key add-subscription --organization '$do ' --name ActivationKey --subscription-id '$client_subs_id '"
100- h regs-40-subs-list-downtest.log " --csv subscription list --organization '$do ' --search 'name = DownTestProduct'" > $logs /subs-list-downrepo.log
101+ skip_measurement=' true' h 43-ak-add-subs-client.log " activation-key add-subscription --organization '$organization ' --name ActivationKey --subscription-id '$client_subs_id '"
102+ h regs-40-subs-list-downtest.log " --csv subscription list --organization '$organization ' --search 'name = DownTestProduct'" > $logs /subs-list-downrepo.log
101103 down_test_subs_id=$( tail -n 1 $logs /subs-list-downrepo.log | cut -d ' ,' -f 1 )
102- h regs-40-ak-add-subs-downtest.log " activation-key add-subscription --organization '$do ' --name ActivationKey --subscription-id '$down_test_subs_id '"
104+ h regs-40-ak-add-subs-downtest.log " activation-key add-subscription --organization '$organization ' --name ActivationKey --subscription-id '$organizationwn_test_subs_id '"
103105
104106 tmp=$( mktemp )
105- h_out " --no-headers --csv capsule list --organization '$do '" | grep ' ^[0-9]\+,' > $tmp
107+ h_out " --no-headers --csv capsule list --organization '$organization '" | grep ' ^[0-9]\+,' > $tmp
106108 for row in $( cut -d ' ' -f 1 $tmp ) ; do
107109 capsule_id=$( echo " $row " | cut -d ' ,' -f 1 )
108110 capsule_name=$( echo " $row " | cut -d ' ,' -f 2 )
@@ -114,11 +116,11 @@ if [ "$skip_down_setup" != "true" ]; then
114116 location_name=" Location for $capsule_name "
115117 fi
116118 h_out " --no-headers --csv subnet list --search 'name = $subnet_name '" | grep --quiet ' ^[0-9]\+,' \
117- || h regs-44-subnet-create-$capsule_name .log " subnet create --name '$subnet_name ' --ipam None --domains '{{ containers_domain }}' --organization '$do ' --network 172.0.0.0 --mask 255.0.0.0 --location '$location_name '"
119+ || h regs-44-subnet-create-$capsule_name .log " subnet create --name '$subnet_name ' --ipam None --domains '{{ containers_domain }}' --organization '$organization ' --network 172.0.0.0 --mask 255.0.0.0 --location '$location_name '"
118120 subnet_id=$( h_out " --output yaml subnet info --name '$subnet_name '" | grep ' ^Id:' | cut -d ' ' -f 2 )
119121 a regs-45-subnet-add-rex-capsule-$capsule_name .log satellite6 -m " shell" -a " curl --silent --insecure -u {{ sat_user }}:{{ sat_pass }} -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' https://localhost//api/v2/subnets/$subnet_id -d '{\" subnet\" : {\" remote_execution_proxy_ids\" : [\" $capsule_id \" ]}}'"
120122 h_out " --no-headers --csv hostgroup list --search 'name = $hostgroup_name '" | grep --quiet ' ^[0-9]\+,' \
121- || ap regs-41-hostgroup-create-$capsule_name .log playbooks/satellite/hostgroup-create.yaml -e " Default_Organization ='$do ' hostgroup_name=$hostgroup_name subnet_name=$subnet_name "
123+ || ap regs-41-hostgroup-create-$capsule_name .log playbooks/satellite/hostgroup-create.yaml -e " organization ='$organization ' hostgroup_name=$hostgroup_name subnet_name=$subnet_name "
122124 done
123125
124126fi
0 commit comments