Browse Source

test user

Change-Id: I89acf4256010e00c0d114a723cf87ee384bf6094
Nate Johnston 10 months ago
parent
commit
b7a32d70dc
2 changed files with 2 additions and 73 deletions
  1. 0
    71
      qualys/scans_test.go
  2. 2
    2
      qualys/xml/scan_list_output.xml

+ 0
- 71
qualys/scans_test.go View File

@@ -1,71 +0,0 @@
1
-package qualys
2
-
3
-import (
4
-	"net/http"
5
-	"net/url"
6
-	"testing"
7
-	"time"
8
-)
9
-
10
-var devCreds Credentials = Credentials{
11
-	Username: "cmcas_ae2",
12
-	Password: "D02debLYko",
13
-}
14
-
15
-func TestLiveScan(t *testing.T) {
16
-	// create client
17
-	c, clientErr := NewClient(&http.Client{}, &devCreds)
18
-
19
-	if clientErr != nil {
20
-		t.Error(clientErr)
21
-	}
22
-
23
-	if baseURL, err := url.Parse("https://qualysapi.qualys.com/api/2.0/fo/scan/"); err != nil {
24
-		t.Error(err)
25
-	} else {
26
-		c.BaseURL = baseURL
27
-	}
28
-
29
-	// create the options
30
-	opts := LaunchScanOptions{
31
-		ScanTitle:   "hello_world",
32
-		ScannerName: "External",
33
-		// OptionID:    923922,
34
-		OptionTitle: "Elastic Cloud Option Profile with Password Guessing",
35
-		IP:          []string{"96.119.99.178"},
36
-	}
37
-
38
-	// launch the request
39
-
40
-	launchScanResponse, err := c.LaunchScan(&opts)
41
-
42
-	if err != nil {
43
-		t.Error(err)
44
-	}
45
-
46
-	// not sure if necessary
47
-	time.Sleep(time.Minute * 1)
48
-
49
-	//time to poll the scan results
50
-	pollOpts := PollScanOptions{
51
-		ScanRef: launchScanResponse.ScanReference,
52
-	}
53
-
54
-	_, pollRespErr := c.PollScanResults(&pollOpts)
55
-
56
-	if pollRespErr != nil {
57
-		t.Error(pollRespErr)
58
-	}
59
-
60
-	// now need to keep polling until the results are all in...
61
-
62
-	resultsOptions := CompletedScanOptions{
63
-		ScanRef: launchScanResponse.ScanReference,
64
-	}
65
-
66
-	_, resultsRespErr := c.GetScanResults(&resultsOptions)
67
-
68
-	if resultsRespErr != nil {
69
-		t.Error(resultsRespErr)
70
-	}
71
-}

+ 2
- 2
qualys/xml/scan_list_output.xml View File

@@ -8,7 +8,7 @@
8 8
         <REF>scan/1486045714.48615</REF>
9 9
         <TYPE>API</TYPE>
10 10
         <TITLE><![CDATA[Elastic Cloud Automated Scan]]></TITLE>
11
-        <USER_LOGIN>cmcas_at1</USER_LOGIN>
11
+        <USER_LOGIN>testuser</USER_LOGIN>
12 12
         <LAUNCH_DATETIME>2017-02-02T14:28:34Z</LAUNCH_DATETIME>
13 13
         <DURATION>00:08:44</DURATION>
14 14
         <PROCESSING_PRIORITY>0 - No Priority</PROCESSING_PRIORITY>
@@ -20,4 +20,4 @@
20 20
       </SCAN>
21 21
     </SCAN_LIST>
22 22
   </RESPONSE>
23
-</SCAN_LIST_OUTPUT>
23
+</SCAN_LIST_OUTPUT>

Loading…
Cancel
Save