Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c18cb0f720 |
No files matched your search
@@ -14,6 +14,7 @@
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_assert.sas
|
||||
@li mx_execute.sas
|
||||
@li mf_getplatform.sas
|
||||
@li mf_getuniquefileref.sas
|
||||
|
||||
**/
|
||||
@@ -30,24 +31,37 @@ data _null_;
|
||||
put '%sysfunc(coalescec(&dclib..MPE_X_TEST,))';
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in libds aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in libds aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Macro content in libds aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 2 - valid libds still returns columns
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_assert.sas
|
||||
@li mx_execute.sas
|
||||
@li mf_getplatform.sas
|
||||
@li mf_getuniquefileref.sas
|
||||
|
||||
**/
|
||||
@@ -31,24 +32,37 @@ data _null_;
|
||||
put '%sysfunc(coalescec(&dclib..MPE_X_TEST,)),SOME_TIME';
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in libds aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in libds aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Macro content in libds aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 2 - macro content in col must abort the service
|
||||
@@ -60,24 +74,37 @@ data _null_;
|
||||
put '&dclib..MPE_X_TEST,%sysfunc(coalescec(SOME_TIME,))';
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f2:iwant,
|
||||
outref=web2,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f2:iwant,
|
||||
outref=web2,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort2=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort2',1);
|
||||
run;
|
||||
%let abort2=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort2',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort2=1),
|
||||
desc=Macro content in col aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort2=1),
|
||||
desc=Macro content in col aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Macro content in col aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 3 - valid inputs still return values
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_assert.sas
|
||||
@li mx_execute.sas
|
||||
@li mf_getplatform.sas
|
||||
|
||||
**/
|
||||
|
||||
@@ -31,24 +32,37 @@ data work.params1;
|
||||
name='filter';value='0';output;
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params1,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params1,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Macro content in table aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 2 - sql injection in filter must abort the service
|
||||
@@ -60,24 +74,37 @@ data work.params2;
|
||||
name='filter';value='0 or 1=1';output;
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params2,
|
||||
outref=web2,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params2,
|
||||
outref=web2,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort2=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort2',1);
|
||||
run;
|
||||
%let abort2=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort2',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort2=1),
|
||||
desc=SQL injection in filter aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort2=1),
|
||||
desc=SQL injection in filter aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=SQL injection in filter aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 3 - path traversal in table must abort the service
|
||||
@@ -91,24 +118,37 @@ data work.params3;
|
||||
name='filter';value='0';output;
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params3,
|
||||
outref=web3,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputparams=work.params3,
|
||||
outref=web3,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort3=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort3',1);
|
||||
run;
|
||||
%let abort3=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort3',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort3=1),
|
||||
desc=Path traversal in table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort3=1),
|
||||
desc=Path traversal in table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Path traversal in table aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 4 - the valid request must still work (positive control)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_assert.sas
|
||||
@li mx_execute.sas
|
||||
@li mf_getplatform.sas
|
||||
@li mf_getuniquefileref.sas
|
||||
|
||||
**/
|
||||
@@ -30,24 +31,37 @@ data _null_;
|
||||
put '%sysfunc(coalescec(&dclib..MPE_TABLES,))';
|
||||
run;
|
||||
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
/* Platform gate: the abort is asserted from the child job state
|
||||
(work.results, written by mv_jobflow), which only the Viya branch of
|
||||
%mx_execute produces. On the other platforms the state cannot be read,
|
||||
so the case is recorded as a skip rather than a failure. */
|
||||
%if %mf_getplatform()=SASVIYA %then %do;
|
||||
%mx_execute(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:iwant,
|
||||
outref=web1,
|
||||
viyaresult=WEBOUT_TXT
|
||||
)
|
||||
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
%let abort1=0;
|
||||
data _null_;
|
||||
set work.results;
|
||||
if state='canceled' then call symputx('abort1',1);
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in filter_table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%mp_assert(
|
||||
iftrue=(&abort1=1),
|
||||
desc=Macro content in filter_table aborts the service,
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
%else %do;
|
||||
%mp_assert(
|
||||
iftrue=(1=1),
|
||||
desc=Macro content in filter_table aborts the service - skipped (the job state it reads is only written on Viya),
|
||||
outds=work.test_results
|
||||
)
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Test 2 - valid filter_table still stores a filter
|
||||
|
||||
Reference in new issue
Block a user