Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue PR #6001 resulted in test case updatenode_syncfile_EXECUTE failed #6016 #6018

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

immarvin
Copy link
Contributor

This PR fixes issue #6016 :

for EXECUTE, only the update of <file> in sync list will trigger the invocation of post sync file <file>.post

UT:

[root@boston02 updatenode]# XCATTEST_CN=sn02 xcattest -t updatenode_syncfile_EXECUTE
xCAT automated test started at Wed Feb 20 23:08:47 2019
******************************
To detect current test environment
******************************
Detecting: OS = linux
Detecting: ARCH = ppc64le
Detecting: HCP = openbmc
******************************
loading test cases
******************************
To run:
updatenode_syncfile_EXECUTE
******************************
Start to run test cases
******************************
------START::updatenode_syncfile_EXECUTE::Time:Wed Feb 20 23:08:49 2019------

RUN:mkdir -p /tmp/updatenode_syncfile_EXECUTE/ [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:
CHECK:rc == 0	[Pass]

RUN:touch /tmp/updatenode_syncfile_EXECUTE/file [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:
CHECK:rc == 0	[Pass]

RUN:echo "echo hello > /tmp/test" > /tmp/updatenode_syncfile_EXECUTE/file.post [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:
CHECK:rc == 0	[Pass]

RUN:chmod a+x /tmp/updatenode_syncfile_EXECUTE/file.post [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:mkdir -p /tmp/updatenode_syncfile_EXECUTE/ [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:echo "/tmp/updatenode_syncfile_EXECUTE/file -> /tmp/file" > /tmp/updatenode_syncfile_EXECUTE/synclist [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:echo "EXECUTE:" >> /tmp/updatenode_syncfile_EXECUTE/synclist [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:echo "/tmp/updatenode_syncfile_EXECUTE/file.post" >> /tmp/updatenode_syncfile_EXECUTE/synclist [Wed Feb 20 23:08:49 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:chdef -t osimage -o __GETNODEATTR(sn02,provmethod)__ synclists=/tmp/updatenode_syncfile_EXECUTE/synclist [Wed Feb 20 23:08:49 2019]
ElapsedTime:1 sec
RETURN rc = 0
OUTPUT:
1 object definitions have been created or modified.
CHECK:rc == 0	[Pass]

RUN:updatenode sn02 -F [Wed Feb 20 23:08:50 2019]
ElapsedTime:2 sec
RETURN rc = 0
OUTPUT:
File synchronization has completed for nodes: "sn02"
CHECK:rc == 0	[Pass]

RUN:xdsh sn02 "cat /tmp/test" [Wed Feb 20 23:08:52 2019]
ElapsedTime:1 sec
RETURN rc = 0
OUTPUT:
sn02: hello
CHECK:rc == 0	[Pass]
CHECK:output =~ hello	[Pass]

RUN:xdsh sn02 "rm -rf /tmp/test" [Wed Feb 20 23:08:53 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

RUN:updatenode sn02 -F [Wed Feb 20 23:08:53 2019]
ElapsedTime:2 sec
RETURN rc = 0
OUTPUT:
File synchronization has completed for nodes: "sn02"
CHECK:rc == 0	[Pass]

RUN:xdsh sn02 "cat /tmp/test" [Wed Feb 20 23:08:55 2019]
ElapsedTime:0 sec
RETURN rc = 1
OUTPUT:
[boston02]: sn02: cat: /tmp/test: No such file or directory
CHECK:rc != 0	[Pass]
CHECK:output =~ No such file or directory	[Pass]

RUN:xdsh sn02 "rm -rf /tmp/test" [Wed Feb 20 23:08:55 2019]
ElapsedTime:1 sec
RETURN rc = 0
OUTPUT:

RUN:chdef -t osimage -o  __GETNODEATTR(sn02,provmethod)__ synclists= [Wed Feb 20 23:08:56 2019]
ElapsedTime:1 sec
RETURN rc = 0
OUTPUT:
1 object definitions have been created or modified.
CHECK:rc == 0	[Pass]

RUN:rm -rf /tmp/updatenode_syncfile_EXECUTE/ [Wed Feb 20 23:08:57 2019]
ElapsedTime:0 sec
RETURN rc = 0
OUTPUT:

------END::updatenode_syncfile_EXECUTE::Passed::Time:Wed Feb 20 23:08:57 2019 ::Duration::8 sec------
------Total: 1 , Failed: 0------

xCAT automated test finished at Wed Feb 20 23:08:57 2019
Please check results in the /opt/xcat/bin/../share/xcat/tools/autotest/result/,
and see /opt/xcat/bin/../share/xcat/tools/autotest/result//failedcases.20190220230847 file for failed cases.
see /opt/xcat/bin/../share/xcat/tools/autotest/result//performance.report.20190220230847 file for time consumption
[root@boston02 updatenode]#

@immarvin immarvin requested a review from hu-weihua February 21, 2019 04:09
@immarvin immarvin added this to the 2.14.6 milestone Feb 21, 2019
cmd:echo "echo hello > /tmp/test" > /tmp/updatenode_syncfile_EXECUTE/file.post
check:rc==0
cmd:chmod a+x /tmp/updatenode_syncfile_EXECUTE/file.post
cmd:mkdir -p /tmp/updatenode_syncfile_EXECUTE/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does line 176 duplicate with line 169?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@hu-weihua
Copy link

It is ok for me, thanks @immarvin

@hu-weihua hu-weihua merged commit ba4aa7f into xcat2:master Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants