[libdrm,3/3] amdgpu: A new option to run tests on render node

Submitted by Xie, AlexBin on Jan. 19, 2017, 10:53 p.m.

Details

Message ID 1484866391-17175-3-git-send-email-AlexBin.Xie@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Xie, AlexBin Jan. 19, 2017, 10:53 p.m.
Tested:
1. As root, tests passed on primary.
2. As root, BO export/import failed on render node as expected.
3. As non-privileged user, tests failed on primary as expected.
4. As non-privileged user, only BO export/import
   failed on render node as expected.

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
---
 tests/amdgpu/amdgpu_test.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c
index 2437db4..a6f1dd1 100644
--- a/tests/amdgpu/amdgpu_test.c
+++ b/tests/amdgpu/amdgpu_test.c
@@ -109,13 +109,14 @@  static void display_test_suites(void)
 
 /** Help string for command line parameters */
 static const char usage[] =
-	"Usage: %s [-hl] [<-s <suite id>> [-t <test id>]] [-d <device_id>]\n"
+	"Usage: %s [-hlr] [<-s <suite id>> [-t <test id>]] [-d <device_id>]\n"
 	"where:\n"
 	"       l - Display all suites and their tests\n"
+	"       r - Run the tests on render node\n"
 	"       d - Choose which device to run tests\n"
 	"       h - Display this help\n";
 /** Specified options strings for getopt */
-static const char options[]   = "hls:t:d:";
+static const char options[]   = "hlrs:t:d:";
 
 /* Open AMD devices.
  * Return the number of AMD device openned.
@@ -241,6 +242,7 @@  int main(int argc, char **argv)
 	int suite_id = -1;	/* By default run everything */
 	int test_id  = -1;	/* By default run all tests in the suite */
 	int device_id = 0;	/* By default run most tests on device 0 */
+	int render_node = 0;	/* By default run most tests on primary node */
 	CU_pSuite pSuite = NULL;
 	CU_pTest  pTest  = NULL;
 
@@ -272,6 +274,9 @@  int main(int argc, char **argv)
 		case 'd':
 			device_id = atoi(optarg);
 			break;
+		case 'r':
+			render_node = 1;
+			break;
 		case '?':
 		case 'h':
 			fprintf(stderr, usage, argv[0]);
@@ -282,7 +287,7 @@  int main(int argc, char **argv)
 		}
 	}
 
-	amdgpu_open_devices(0);
+	amdgpu_open_devices(render_node);
 
 	if (drm_amdgpu[0] < 0) {
 		perror("Cannot open AMDGPU device.\n");

Comments

HI Alex,

A couple of small idea(s) for future work (?).

On 19 January 2017 at 22:53, Alex Xie <AlexBin.Xie@amd.com> wrote:
> Tested:
> 1. As root, tests passed on primary.
Add auth mechanism and request run outside of X environment (switching
to TTY should work).
Then adjust the suggestion s/run as root/run in TTY/ ?

> 2. As root, BO export/import failed on render node as expected.
Afaict those can never succeed, so might as well change the test to
expect failure [when using the render node], or at least print a
message "the following failure is expected" ?

Thanks the series !
Emil
Hi Emil,

Point 1 will be left for future patch.

Current error message is following.
Error: Permission denied. Hint:Try to run this test program as root.

I am thinking change it. Error message will be:
Error: Permission denied. Hint:Try to run this test program as root or in TTY.

Thanks,
Alex Bin Xie

-----Original Message-----
From: Emil Velikov [mailto:emil.l.velikov@gmail.com] 

Sent: Friday, January 20, 2017 8:31 AM
To: Xie, AlexBin <AlexBin.Xie@amd.com>
Cc: amd-gfx mailing list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH libdrm 3/3] amdgpu: A new option to run tests on render node

HI Alex,

A couple of small idea(s) for future work (?).

On 19 January 2017 at 22:53, Alex Xie <AlexBin.Xie@amd.com> wrote:
> Tested:

> 1. As root, tests passed on primary.

Add auth mechanism and request run outside of X environment (switching
to TTY should work).
Then adjust the suggestion s/run as root/run in TTY/ ?

> 2. As root, BO export/import failed on render node as expected.

Afaict those can never succeed, so might as well change the test to
expect failure [when using the render node], or at least print a
message "the following failure is expected" ?

Thanks the series !
Emil
On 24 January 2017 at 22:39, Xie, AlexBin <AlexBin.Xie@amd.com> wrote:
> Hi Emil,
>
> Point 1 will be left for future patch.
>
Definitely. I did not mean to ask/push you to address that here.

> Current error message is following.
> Error: Permission denied. Hint:Try to run this test program as root.
>
> I am thinking change it. Error message will be:
> Error: Permission denied. Hint:Try to run this test program as root or in TTY.
>
I'm still leaning that in 2017 asking people to run anything as root
is bad idea. Anyway it's just be being pedantic.

-Emil