Sanity Test Application for SQLShare deployment

handsgridΔιακομιστές

4 Δεκ 2013 (πριν από 4 χρόνια και 27 μέρες)

148 εμφανίσεις

Sanity Test Application for SQLShare
deployment


Overview and Instructions

This executable performs tests on the the installed sqlshare

project
. The tests are configurable and

can
be used
to test

loc
al as well as remote deployment.

Download the zip file
that contains the executable and a sample XML configuration file.

Requirements

.NET 4.0 is required to be installed on the system.

The executable and XML config file (sqlsharetest.config) need to be in the same directory.

Please populate the values in sqls
haretest.config as described in this document.


.
NET 4.0 installation

If the operating system does not come with .NET 4.0 installed, please install it before running the
application.

Installation URL

http://www.microsoft.com/en
-
us/download/details.aspx?id=17851

Supported operating systems for
installing

.NET 4.0

Windows 7, Windows 7 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008, Windows Server
2008 R2, Wi
ndows Server 2008 R2 SP1, Windows Vista Service Pack 1, Windows XP Service Pack 3

o

Windows XP SP3

o

Windows Server 2003 SP2

o

Windows Vista SP1 or later

o

Windows Server 2008 (not supported on Server Core Role)

o

Windows 7

o

Windows Server 2008 R2 (not supported on
Server Core Role)

o

Windows 7 SP1

o

Windows Server 2008 R2 SP1


Configuration file

The configuration file is in the XML Format and is called sqlsharetest.config.

Here is a sample:

<?xml version="1.0" encoding="utf
-
8" ?>


<SQLShareSanityTestSettings>


<add
key="UserAgent" value="SQLSanityTest 001" />


<add key="URL" value="https://sqlshare
-
rest.cloudapp.net"/>


<add key="Authorization" value="ss_apikey sagarc@washington.edu :
mypasswordkey
" />


<add key="IgnoreCerificateErrors" value ="true" />


<add key="UploadFileName" value ="sagar2_square.csv"/>


<add key="TestUserName" value="test9"/>


<add key="SQLQuery1" value ="SELECT * FROM
[sagarc@washington.edu].[table_cnv_test.txt]
"/>


<add key="SQLQuery2" value ="SELECT * FROM
[sagarc@washington.edu].[table_sqlsharetest.txt]"/>


<add key="LogFilePrefix" value ="SQLLog
"/>


<add key="DBUploadTimeout" value="300"/>



</SQLShareSanityTestSettings>



Description of Keys in the config file


UserAgent


The useragent field in
the HTTP Header request


<add key="UserAgent" value="SQLSanityTest 001" />


URL

URL of the local or remote server


<add key="URL" value="https://sqlshare
-
rest.cloudapp.net"/>



Authorization


Authorization field in the HTTP header.



<add key="Aut
horization" value="ss_apikey sagarc@washington.edu :
mypasswordkey
" />


IgnoreCerificateErrors


If true , all certificate related errors during SSL negotiation will be ignored.



<add key="IgnoreCerificateErrors" value ="true" />



UploadFileName


Name used in the HTTP request when the data is uploaded. This is not a physical file that needs to be
present on the client. The name will be modified based on the current time(for uniqueness)
.



<add key="UploadFileName" value ="sagar2_square.csv"/>


TestUserName

Name of the test user created.

The name will be modified based on the current time(for uniqueness).


<add key="TestUserName" value="test9"/>


SQLQuery{n}


Any number of SQL queries can be executed by the test application.



<ad
d key="SQLQuery1" value ="SELECT * FROM
[sagarc@washington.edu].[table_cnv_test.txt]
"/>


<add key="SQLQuery2" value ="SELECT * FROM
[sagarc@washington.edu].[table_sqlsharetest.txt]"/>



LogFilePrefix


Prefix of the log file that will be created when th
e test is run. To allow multiple log files to coexist, the
name is appended by the current time and date.


<add key="LogFilePrefix" value ="SQLLog
"/>


DBUploadTimeout


The database needs to be polled continuously to verify that a file has been
successfully uploaded.

The value is the timeout in seconds.


<add key="DBUploadTimeout" value="300"/>



Sample Execution




If for some reason, the log file could not be created (permission issue etc), it will only use the console.



If you click yes,

the output will be to the console

only
.



Sanity Test Application for SQLShare:

**************************************************************


BEGIN TEST1

Status Code:OK, Status Description:OK

The following headers were received in the response:

Connect
ion:close

Content
-
Length:0

Date:Thu, 28 Jun 2012 12:22:56 GMT

Server:Microsoft
-
IIS/7.0

X
-
Powered
-
By:ASP.NET

END TEST1

**************************************************************

**************************************************************

BEGIN WHOAMI

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:22:56 GMT

Server:Microsoft
-
II
S/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

{"schema":"sagarc@washington.edu","username":"sagarc@washington.edu"}

END WHOAMI

**************************************************************

BEGIN CreateUser

Status Code:Created, Status Description:C
reated

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:22:57 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET


{"schema":"test98cf23054e4a16b4","username":"test98cf23054e4a16b4"}



END CreateUser

**************************************************************


**************************************************************

BEGIN GETUSER

Status
Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:22:57 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

{"schema":"test98cf23054e4a16b4","username":"test98cf23054e4a16b4"}

END GETUSER

**************************************************************

**************************************************************

BEGI
N GETALLDATASETS

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:22:59 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET


[{"date_created":"Tue, 09 Aug 2011 19:13:50 GMT","date_modified":"Tue, 09 Aug 2011 19:14:13
GMT","description":"","is_public":true,"is_shared":false,"name":"failed alignment dna
samples","owner":"billhowe@washington.edu","popularity":0,"qualified_name":"[billhowe].[failed alignment dna samples]","sql_c
ode":"select
*
\
u000a from billhowe.[dnasamples_parsed_name] d
\
u000a where status_id = (select id from billhowe.[statuses.csv] whe
re name = 'failed
alignment')","tags":[],"url":"
\
/REST.svc
\
/v2
\
/db
\
/dataset
\
/billhowe
\
/failed%20alignment%20dna%20samples"},{"date_created":"Thu, 28 Jun
2012 07:31:36 GMT","date_modified":"Thu, 28 Jun 2012 08:09:33
GMT","description":"","is_public":false,"
is_shared":false,"name":"sagar2_square.csv","owner":"sagarc@washington.edu","popularity":0,"quali
fied_name":"[sagarc@washington.edu].[sagar2_square.csv]","sql_code":"SELECT * FROM
[sagarc@washington.edu].[table_sagar2_square.csv]","tags":[],"url":"
\
/REST.s
vc
\
/v2
\
/db
\
/dataset
\
/sagarc%40wash
ington.edu
\
/sagar2_square
.csv"}

]

Note: Actual data returned was several pages, removed for brevity.

END GETALLDATASETS

**************************************************************

**************************************
************************

BEGIN UploadFileTest

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu,

28 Jun 2012 12:23:01 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

File IID is : F4AAC06E5E

END UploadFileTest

**************************************************************

**************************************************
************

BEGIN GetDefaultParserTest

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28
Jun 2012 12:23:01 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

{"columns":[{"name":"Depth (m)"},{"name":"description"},{"name":"Nitrite (uM)"},{"name":"Nitrate
(uM)"},{"name":"ammonium"},{"name":"nM
\
/day"}],"dataset_name":"8
cf23054e4a3dc5sagar2_square.csv","description":"","is_public":false,"
parser":{"delimiter":",","has_column_headers":true},"sample_data":[["115","deep","0.02","31.29","0.132","357.626886521"],["50
","deep","0.
018","33","0.189","330.645866408"],["16.5","below
NO2 max","0.12","21.9","0.47","223.517369129"],["14","nitrite
max","0.12","21.9","0.47","146.101894726"],["7.8","chlorop
max","0.1","14.32","0.236","19.3343527428"]],"table_name":"table_8cf23054e4a3dc5sagar2_square.csv"} END GetDefaultParserTest

**********
****************************************************

BEGIN DatabasePutTest

Status Code:Accepted, Status Description:Accepted

The following headers were received in the response:

Connection:close

Content
-
Length:0

Date:Thu, 28 Jun 2012 12:23:01 GMT

Server:Mi
crosoft
-
IIS/7.0

X
-
Powered
-
By:ASP.NET

END DatabasePutTest

START DatabasePolling

Status Code:Accepted, Status Description:Accepted

The following headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:23:02 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

{"records_total":6,"records_uploaded":6}

Status Code:Created, Status Description:Created

The following
headers were received in the response:

Transfer
-
Encoding:chunked

Connection:close

Cache
-
Control:private

Content
-
Type:application/json; charset=utf
-
8

Date:Thu, 28 Jun 2012 12:23:05 GMT

Location:/REST.svc/v1/db/query/sagarc%40washington.edu/8cf23054e4a3dc5sa
gar2_square.csv

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

{"records_total":6,"records_uploaded":6}

**************************************************************

BEGIN ExecuteSQLQuery(query=SELECT * FROM [sagarc@washington.ed
u].[table_cnv_test.txt]
)

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Content
-
Disposition:attachment;filename="untitled.csv"

Connection:close

Cache
-
Control:private

Content
-
Type:APPLIC
ATION/OCTET
-
STREAM

Date:Thu, 28 Jun 2012 12:23:05 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

strain,chr,start_bp,end_bp,ratio

thapsIT,Chr1,1,25200,0.722854

thapsIT,Chr1,67901,70900,0.531851

thapsIT,
Chr1,80501,82300,0.267906

thapsIT,Chr1,294101,296500,0.741694

thapsIT,Chr1,337401,340500,1.78102

thapsIT,Chr1,343801,352200,1.73126

thapsIT,Chr1,353701,358900,1.69538

thapsIT,Chr1,358901,370300,0.00238719

thapsIT,Chr1,538801,543100,0.72522

thapsIT,Chr1,122
2501,1224400,0.243207

END ExecuteSQLQuery

Note: Response reduced for brevity

**************************************************************

**************************************************************

BEGIN ExecuteSQLQuery(query=SELECT * FROM [sagarc@was
hington.edu].[table_sqlsharetest.txt])

Status Code:OK, Status Description:OK

The following headers were received in the response:

Transfer
-
Encoding:chunked

Content
-
Disposition:attachment;filename="untitled.csv"

Connection:close

Cache
-
Control:private

Conten
t
-
Type:APPLICATION/OCTET
-
STREAM

Date:Thu, 28 Jun 2012 12:23:05 GMT

Server:Microsoft
-
IIS/7.0

X
-
AspNet
-
Version:4.0.30319

X
-
Powered
-
By:ASP.NET

Column1,Column2,Column3,Column4,Column5

This,is,a,test,file.

END ExecuteSQLQuery

**************************************************************