All of lore.kernel.org
 help / color / mirror / Atom feed
From: OpenBMC Patches <openbmc-patches@stwcx.xyz>
To: openbmc@lists.ozlabs.org
Subject: [PATCH openbmc-test-automation 16/60] Moved Read Attribute and Read Properties to rest_client
Date: Mon, 11 Jan 2016 10:49:42 -0600	[thread overview]
Message-ID: <1452531026-13715-17-git-send-email-openbmc-patches@stwcx.xyz> (raw)
In-Reply-To: <1452531026-13715-1-git-send-email-openbmc-patches@stwcx.xyz>

From: Manjunath A Kumatagi <mkumatag@in.ibm.com>

---
 lib/rest_client.robot      | 13 +++++++++++++
 tests/test_inventory.robot | 14 +-------------
 tests/test_obmcrest.robot  | 24 +++++++-----------------
 tests/test_sensors.robot   |  7 +------
 4 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index b972195..f0c1ba3 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -102,3 +102,16 @@ Log Response
 Logging
     [Arguments]    ${msg}    ${console}=default False
     Log    ${msg}    console=True
+
+Read Attribute
+    [arguments]    ${uri}    ${attr}
+    ${resp} =   OpenBMC Get Request    ${uri}/attr/${attr}
+    [return]    ${resp.content}
+
+
+Read Properties
+    [arguments]    ${uri}
+    ${resp} =   OpenBMC Get Request    ${uri}
+    Should Be Equal As Strings    ${resp.status_code}    ${HTTP_OK}
+    ${content}=     To Json    ${resp.content}
+    [return]    ${content}
\ No newline at end of file
diff --git a/tests/test_inventory.robot b/tests/test_inventory.robot
index fde52e1..afe4613 100644
--- a/tests/test_inventory.robot
+++ b/tests/test_inventory.robot
@@ -19,7 +19,7 @@ List Inventory
 Verify dimm vpd
 	: FOR 	${INDEX} 	IN RANGE 	0 	4
 	\	log 	${INDEX}
-	\	${value} =	Read attribute	/org/openbmc/inventory/system/chassis/motherboard/dimm${INDEX}	fru_type
+	\	${value} =	Read Attribute	/org/openbmc/inventory/system/chassis/motherboard/dimm${INDEX}	fru_type
 	\	Should Be Equal	${value}	"DIMM"
 
 
@@ -39,15 +39,3 @@ Should Be Valid Dimm Properties
 	${ret}=    Get Inventory Items Schema	DIMM
 	: FOR    ${ELEMENT}    IN    @{ret}
 	\    Should Contain    ${props}    ${ELEMENT}
-
-
-Read attribute
-	[arguments]	${uri}	${attr}
-	${resp} =	OpenBMC Get Request	${uri}/attr/${attr}
-	[return]	${resp.content}
-
-
-Read Properties
-	[arguments]	${uri}
-	${resp} =	OpenBMC Get Request	${uri}
-	[return]	${resp.content}
diff --git a/tests/test_obmcrest.robot b/tests/test_obmcrest.robot
index 0c3d5ea..75eb6d9 100644
--- a/tests/test_obmcrest.robot
+++ b/tests/test_obmcrest.robot
@@ -11,24 +11,23 @@ Resource		../lib/rest_client.robot
 
 *** Test Cases ***
 Good connection for testing
-	${resp} =	Read Properties	/
-	${jdata}=	To Json 	${resp.content}
-	${c}= 		get from List 	${jdata} 	0
-	Should Contain		"/org"	${c}	
+	${content} =	Read Properties	/
+	${c}= 		get from List 	${content} 	0
+	Should Contain		"/org"	${c}
 
 
 Get an object with no properties 
-	${resp} =	Read Properties	/org/openbmc/inventory
-	Should Be Empty	${resp.content}
+	${content} =	Read Properties	/org/openbmc/inventory
+	Should Not Be Empty	${content}
 
 
 Get a Property
-	${resp} =	Read attribute	/org/openbmc/inventory/system/chassis/motherboard/cpu0	is_fru
+	${resp} =	Read Attribute	/org/openbmc/inventory/system/chassis/motherboard/cpu0	is_fru
 	Should Contain		1	${resp}	
 
 
 Get a null Property
-	${resp} =	Read attribute	/org/openbmc/inventory	is_fru
+	${resp} =	Read Attribute	/org/openbmc/inventory	is_fru
 	Should Contain		1	${resp}	
 
 
@@ -54,12 +53,3 @@ Issue a PUT
 
 
 *** Keywords ***
-Read Properties
-	[arguments]	${uri}
-	${resp} =	OpenBMC Get Request	${uri}
-	[return]	${resp}
-
-Read attribute
-	[arguments]	${uri}	${attr}
-	${resp} =	OpenBMC Get Request	${uri}/attr/${attr}
-	[return]	${resp.content}
\ No newline at end of file
diff --git a/tests/test_sensors.robot b/tests/test_sensors.robot
index 79ba4d7..3d17360 100644
--- a/tests/test_sensors.robot
+++ b/tests/test_sensors.robot
@@ -22,7 +22,7 @@ Execute ipmi BT capabilities command
 
 Execute Set Sensor boot count
 	Run IPMI command  0x04 0x30 0x09 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00
-	${value} =  Read attribute	/org/openbmc/sensor/virtual/BootCount	value
+	${value} =  Read Attribute	/org/openbmc/sensor/virtual/BootCount	value
 	Should Be Equal		${value}	"53"
 
 
@@ -36,8 +36,3 @@ Run IPMI Command
 	[arguments]	${args}
 	${output}=	Execute Command    /home/root/ipmitool -I dbus raw ${args}
 	[return]	${output}
-
-Read attribute
-	[arguments]	${uri}	${attr}
-	${resp} =	OpenBMC Get Request	${uri}/attr/${attr}
-	[return]	${resp.content}
\ No newline at end of file
-- 
2.6.4

  parent reply	other threads:[~2016-01-11 16:50 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 16:49 [PATCH openbmc-test-automation 00/60] Pull Manjunath's automation repository OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 01/60] first commit OpenBMC Patches
2016-01-12  4:18   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 02/60] added files OpenBMC Patches
2016-01-12  4:20   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 03/60] Update README.md OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 04/60] added log statement OpenBMC Patches
2016-01-12  4:20   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 05/60] added testcase for etc passwd OpenBMC Patches
2016-01-12  4:20   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 06/60] Added git ignore file OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 07/60] Use argumnet file with pyrobot and added instructions to READEME file OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 08/60] Update README for better html display OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 09/60] Added Inventory list testcase OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 10/60] Added DIMM specific inventory tests OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 11/60] base add for sensor tests OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 12/60] fixed errors in tox and generate_argumentfile.sh script OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 13/60] fixed review comments OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 14/60] created loops for tests OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 15/60] Add initial rest test cases Support to test Null properties OpenBMC Patches
2016-01-11 16:49 ` OpenBMC Patches [this message]
2016-01-11 16:49 ` [PATCH openbmc-test-automation 17/60] fix review comment OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 18/60] Added full sensor suite OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 19/60] Update README.md OpenBMC Patches
2016-01-12  4:21   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 20/60] Added SSL tests OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 21/60] Handle new rest client from Brad OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 22/60] Ran the tests and fixed errors in SSL tests OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 23/60] Modified the doc OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 24/60] Added firmware version validation test OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 25/60] update readme file with tox version OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 26/60] Fix errors OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 27/60] Fix Errors in test_obmcrest.robot and removed the empty testcases OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 28/60] Added one more testcase to test non-ssl connection to port 443 OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 29/60] OpenBMC REST Testing OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 30/60] updated the REST API for firmware version OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 31/60] first commit OpenBMC Patches
2016-01-12  5:07   ` Stewart Smith
2016-01-11 16:49 ` [PATCH openbmc-test-automation 32/60] added files OpenBMC Patches
2016-01-11 16:49 ` [PATCH openbmc-test-automation 33/60] Update README.md OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 34/60] added log statement OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 35/60] added testcase for etc passwd OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 36/60] Added git ignore file OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 37/60] Use argumnet file with pyrobot and added instructions to READEME file OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 38/60] Update README for better html display OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 39/60] Added Inventory list testcase OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 40/60] Added DIMM specific inventory tests OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 41/60] base add for sensor tests OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 42/60] fixed errors in tox and generate_argumentfile.sh script OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 43/60] fixed review comments OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 44/60] created loops for tests OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 45/60] Add initial rest test cases Support to test Null properties OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 46/60] Moved Read Attribute and Read Properties to rest_client OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 47/60] fix review comment OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 48/60] Added full sensor suite OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 49/60] Update README.md OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 50/60] Added SSL tests OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 51/60] Handle new rest client from Brad OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 52/60] Ran the tests and fixed errors in SSL tests OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 53/60] Modified the doc OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 54/60] Added firmware version validation test OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 55/60] update readme file with tox version OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 56/60] Fix errors OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 57/60] Fix Errors in test_obmcrest.robot and removed the empty testcases OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 58/60] Added one more testcase to test non-ssl connection to port 443 OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 59/60] OpenBMC REST Testing OpenBMC Patches
2016-01-11 16:50 ` [PATCH openbmc-test-automation 60/60] updated the REST API for firmware version OpenBMC Patches
2016-01-12  0:00 ` [PATCH openbmc-test-automation 00/60] Pull Manjunath's automation repository Daniel Axtens
2016-01-12  0:10 ` Cyril Bur
2016-01-12  9:35   ` Manjunath A Kumatagi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452531026-13715-17-git-send-email-openbmc-patches@stwcx.xyz \
    --to=openbmc-patches@stwcx.xyz \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.