Skip to content

Commit fbbcf15

Browse files
committed
Simplify VCH management API metadata test cases (#8150)
Previously, it was necessary to retry Get Version due to the potential for a race between server initialization and test execution. Now that the Start VIC Machine Server keyword waits for the server to start (280704f), this race is no longer possible. Simplify the test code accordingly. Additionally, eliminate duplicaton of the service name between setup and diagnostic keywords by defining a variable.
1 parent 4ef5b27 commit fbbcf15

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

tests/resources/Group23-VIC-Machine-Service-Util.robot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ${RC} The return code of the last curl invocation
2323
${OUTPUT} The output of the last curl invocation
2424
${STATUS} The HTTP status of the last curl invocation
2525

26+
${VIC_MACHINE_SERVER_BIN} ./bin/vic-machine-server
2627
${VIC_MACHINE_SERVER_LOG} vic-machine-server.log
2728
${SERVING_AT_TEXT} Serving vic machine at
2829

@@ -32,7 +33,7 @@ Start VIC Machine Server
3233
${dir_name}= Evaluate 'group23_log_dir' + str(random.randint(1000,9999)) modules=random
3334
Set Suite Variable ${SERVER_LOG_FILE} ${dir_name}/${VIC_MACHINE_SERVER_LOG}
3435

35-
${handle}= Start Process ./bin/vic-machine-server --scheme http --log-directory ${dir_name}/ shell=True cwd=/go/src/github.com/vmware/vic
36+
${handle}= Start Process ${VIC_MACHINE_SERVER_BIN} --scheme http --log-directory ${dir_name}/ shell=True cwd=/go/src/github.com/vmware/vic
3637
Set Suite Variable ${SERVER_HANDLE} ${handle}
3738
Process Should Be Running ${handle}
3839
Sleep 5sec

tests/test-cases/Group23-VIC-Machine-Service/23-01-Metadata.robot

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ Default Tags
2323

2424
*** Keywords ***
2525
Get Version
26-
${out}= Run netstat -l | grep 1337
27-
Log ${out}
28-
${out}= Run ps aux | grep vic-machine-server
29-
Log ${out}
3026
Get Path version
31-
Verify Return Code
3227

3328
Get Hello
3429
Get Path hello
@@ -44,8 +39,9 @@ Verify Hello
4439

4540
*** Test Cases ***
4641
Get Version
47-
Wait Until Keyword Succeeds 5x 1s Get Version
42+
Get Version
4843

44+
Verify Return Code
4945
Verify Status Ok
5046
Verify Version
5147

0 commit comments

Comments
 (0)