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 mp_assert.sas
12 @li mx_execute.sas
13
14**/
15
16%let _program=&appLoc/services/admin/refreshcatalog;
17
18/**
19 * Test 1 - an invalid libref must abort the service
20 */
21data work.params1;
22 length name $32 value $1000;
23 name='libref';value='A.%sysevalf(3+4)B';output;
24run;
25
26%mx_execute(&_program,
27 viyacontext=&defaultcontext,
28 inputparams=work.params1,
29 outref=web1,
30 viyaresult=WEBOUT_TXT
31)
32
33%let abort1=0;
34data _null_;
35 set work.results;
36 if state='canceled' then call symputx('abort1',1);
37run;
38
39%mp_assert(
40 iftrue=(&abort1=1),
41 desc=Macro content in libref aborts the service,
42 outds=work.test_results
43)
44
45/**
46 * Test 2 - a valid libref still refreshes the catalog (admin user)
47 */
48data work.params2;
49 length name $32 value $1000;
50 name='libref';value='DCTEST';output;
51run;
52
53%mx_execute(&_program,
54 viyacontext=&defaultcontext,
55 inputparams=work.params2,
56 outlib=web2
57)
58
59%let msgcheck=0;
60data _null_;
61 set web2.sasparams;
62 putlog (_all_)(=);
63 if index(msg,'Catalog Refresh Complete') then call symputx('msgcheck',1);
64run;
65
66%mp_assert(
67 iftrue=(&msgcheck=1),
68 desc=Valid libref refresh completes for admin user,
69 outds=work.test_results
70)
71
72/**
73 * dump results to the log for offline inspection
74 */
75data _null_;
76 set work.test_results;
77 putlog 'TEST_RESULT_LINE: ' test_result ' - ' test_description;
78run;