Bug 1393770

Summary: Can not get ${SERVERS} value when runnning multihosts task
Product: [Retired] Restraint Reporter: qhsong <qsong>
Component: generalAssignee: Artem Savkov <asavkov>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: masterCC: asavkov, bpeck, ccui
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-25 05:56:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
test-multihost.tar.gz none

Description qhsong 2016-11-10 10:14:40 UTC
Created attachment 1219300 [details]
test-multihost.tar.gz

Description of problem:
Can not get ${SERVERS} value

Version-Release number of selected component (if applicable):
0.1.28

How reproducible:
yes

Steps to Reproduce:
1.use following xml
<job>
 <recipeSet>
  <recipe role="SERVERS">
   <task name="ssh-sysrq-c">
     <fetch url="http://10.66.12.120:8080/test-multihost.tar.gz#mul" />
   </task>
  </recipe>
  <recipe>
   <task name="ssh-sysrq-c" role="CLIENTS">
    <fetch url="http://10.66.12.120:8080/test-multihost.tar.gz#mul" />
   </task>
  </recipe>
 </recipeSet>
</job>
2.run restraint with this job


Actual results:
only print ${CLIENTS} not ${SERVER}

Expected results:
print ${CLIENTS} and ${SERVERS}

Additional info:

In env.c:164, I add a line whitch to use g_print to print all env.Here is output:
JOB_MEMBERS=10.73.4.215 localhost
TESTID=1
HARNESS_PREFIX=RSTRNT_
RSTRNT_RECIPE_URL=http://localhost:8081/recipes/1
RSTRNT_RECIPEID=1
RSTRNT_TASKID=1
RSTRNT_TASKNAME=ssh-sysrq-c
RSTRNT_TASKPATH=/mnt/tests/10.66.12.120:8080/test-multihost.tar.gz/mul
RSTRNT_MAXTIME=0
RSTRNT_REBOOTCOUNT=0
RSTRNT_TASKORDER=0
HOME=/root
TERM=vt100
LANG=en_US.UTF-8
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
CLIENTS=10.73.4.215
RECIPE_MEMBERS=10.73.4.215 localhost
(null)
(null)
(null)
(null)
(null)

Seems SERVERS not exist.

Comment 1 Artem Savkov 2016-11-10 12:01:40 UTC
http://gerrit.beaker-project.org/5423

Comment 2 qhsong 2016-11-11 01:46:54 UTC
Seems this problem caused by using role in "TASK" label. In fact, this xml was modified from http://restraint.readthedocs.io/en/latest/jobs.html.
So I think maybe we need modified this document.

Comment 3 Artem Savkov 2016-11-11 08:17:38 UTC
(In reply to qhsong from comment #2)
> Seems this problem caused by using role in "TASK" label. In fact, this xml
> was modified from http://restraint.readthedocs.io/en/latest/jobs.html.
It is more of using both roles in task and recipe tags.

> So I think maybe we need modified this document.

Don't think so, the document is there to demonstrate different applications of "role" argument. It wasn't intended to be used as an example xml. 
Anyway, after fix mentioned in comment#1 is applied it should work this way again.

Comment 4 qhsong 2016-11-11 08:31:29 UTC
Got it.Currently I put role in recipe, it works in beaker and restarintd.
Waiting it to publish.