From 82b8b0a053082f0e79bc9f86ecdf37117b175e63 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 2 Sep 2016 08:51:36 -0700 Subject: [PATCH] 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. --- tests/install_source_graphical.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/install_source_graphical.pm b/tests/install_source_graphical.pm index f4ed781a..8c48eb90 100644 --- a/tests/install_source_graphical.pm +++ b/tests/install_source_graphical.pm @@ -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 = "";