1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-22 10:23:09 +00:00

handle REPOSITORY_GRAPHICAL being http as well as https

I assumed the 'compose location' sent by fedmsg was https, but
in fact it's http (you get redirected to https when you access
it). Could just change the default back to 4, but why not make
it properly robust. Sending without review so this doesn't go
wrong all weekend.
This commit is contained in:
Adam Williamson 2016-09-02 08:51:36 -07:00
parent 315295c4b9
commit 82b8b0a053

View File

@ -13,17 +13,22 @@ sub run {
# select appropriate protocol on the network
assert_and_click "anaconda_install_source_on_the_network";
send_key "tab";
# if we have an NFS repo select NFS (one 'up'), otherwise HTTPS (three 'ups')
my $num;
$num = get_var("REPOSITORY_GRAPHICAL") =~ m/^nfs:/ ? 1 : 3;
for (my $i=0; $i<$num; $i++){
# select appropriate repo type for the URL by pressing 'up' a given
# number of times. default - 3 - is https
my $num = 3;
if (get_var("REPOSITORY_GRAPHICAL") =~ m/^nfs:/) {
$num = 1;
}
if (get_var("REPOSITORY_GRAPHICAL") =~ m/^http:/) {
$num = 4;
}
for (my $i=0; $i<$num; $i++) {
send_key "up";
}
# let's just accept either NFS or HTTP here, if it's the wrong one the
# test will fail soon anyhow
# we accept any of the protocol needles here, if we happened to
# choose wrong the test will fail soon anyhow
assert_screen "anaconda_install_source_selected";
# insert the url
send_key "tab";
my $repourl = "";