Loading...
Searching...
No Matches
refreshcatalog.test.1.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief testing admin refreshcatalog service - admin gate + libref validation (security)
4 @details The service requires membership of the DC administrators
5 group and a well-formed libref (or none). An invalid libref aborts
6 the service, which shows up as a canceled child job (an aborted
7 service registers no webout). The test suite runs as a member of
8 the admin group, so the gate passes here.
9
10 <h4> SAS Macros </h4>
11 @li mpe_assert_abort.sas
12 @li mp_assert.sas
13 @li mpe_execute.sas
14
15 @sasjslint {"maxLineLength": 89}
16
17**/
18
19%let _program=&appLoc/services/admin/refreshcatalog;
20
21/**
22 * Test 1 - an invalid libref must abort the service
23 */
24data work.params1;
25 length name $32 value $1000;
26 name='libref';value='A.%sysevalf(3+4)B';output;
27run;
28
29%mpe_execute(&_program,
30 viyacontext=&defaultcontext,
31 inputparams=work.params1,
32 outref=web1,
33 outstatus=work.ab1,
34 failfast=0,
35 viyaresult=WEBOUT_TXT
36)
37
38%mpe_assert_abort(
39 desc=Macro content in libref aborts the service,
40 outstatus=work.ab1,
41 msg=Invalid libref
42)
43
44/**
45 * Test 2 - a valid libref still refreshes the catalog (admin user)
46 */
47data work.params2;
48 length name $32 value $1000;
49 name='libref';value='DCTEST';output;
50run;
51
52%mpe_execute(&_program,
53 viyacontext=&defaultcontext,
54 inputparams=work.params2,
55 outlib=web2
56)
57
58%let msgcheck=0;
59data _null_;
60 set web2.sasparams;
61 putlog (_all_)(=);
62 if index(msg,'Catalog Refresh Complete') then call symputx('msgcheck',1);
63run;
64
65%mp_assert(
66 iftrue=(&msgcheck=1),
67 desc=Valid libref refresh completes for admin user,
68 outds=work.test_results
69)
70
71/**
72 * dump results to the log for offline inspection
73 */
74data _null_;
75 set work.test_results;
76 putlog 'TEST_RESULT_LINE: ' test_result ' - ' test_description;
77run;