Browse code

Fix : sort variables fetched from env list

In bionic, when exporting env variables, the env list displays
variables in unsorted format.
While fetching we are getting 'https_proxy' before 'http_proxy'
which is failing in comparison to our expected values[1].
This patch sorts the variables fetched from env.

[1] http://logs.openstack.org/30/643130/3/check/devstack-unit-tests/effbf7a/job-output.txt.gz#_2019-03-13_23_12_35_465026

Change-Id: Ie504eabf0d3fec1b97bc711e2702c06bcf75d158

whoami-rajat authored on 2019/03/14 14:31:18
Showing 1 changed files
... ...
@@ -272,7 +272,7 @@ function test_export_proxy_variables {
272 272
 
273 273
     export_proxy_variables
274 274
     expected=$(echo -e "http_proxy=$http_proxy\nhttps_proxy=$https_proxy\nno_proxy=$no_proxy")
275
-    results=$(env | egrep '(http(s)?|no)_proxy=')
275
+    results=$(env | egrep '(http(s)?|no)_proxy=' | sort)
276 276
     if [[ $expected = $results ]]; then
277 277
         passed "OK: Proxy variables are exported when proxy variables are set"
278 278
     else