-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from dolevf/add-unit-tests
add unit tests
- Loading branch information
Showing
9 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import requests | ||
|
||
def test_port_8080(): | ||
response = requests.get('http://10.1.0.13:8080') | ||
assert response.ok | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import requests | ||
import socket | ||
|
||
def test_port_80(): | ||
response = requests.get('http://10.1.0.15/adminer.php') | ||
assert response.ok | ||
assert 'Adminer' in response.text | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import requests | ||
import socket | ||
|
||
def test_port_3306(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
result = sock.connect_ex(('10.1.0.16', 3306)) | ||
assert result == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import socket | ||
|
||
def test_port_6379(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
result = sock.connect_ex(('10.1.0.14', 6379)) | ||
assert result == 0 | ||
|
||
def test_port_22(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
result = sock.connect_ex(('10.1.0.14', 22)) | ||
assert result == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import socket | ||
import requests | ||
|
||
def check_port_80(): | ||
response = requests.get('http://172.16.10.11/backup') | ||
assert response.ok | ||
assert 'index of /backup' in response.text | ||
|
||
def test_port_21(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
result = sock.connect_ex(('172.16.10.11', 21)) | ||
assert result == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import socket | ||
|
||
def test_port_22(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
result = sock.connect_ex(('172.16.10.13', 22)) | ||
assert result == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import requests | ||
|
||
def test_port_8081(): | ||
response = requests.get('http://172.16.10.10:8081') | ||
assert response.ok | ||
assert 'ACME Hyper Branding' in response.text | ||
|
||
def test_upload_page(): | ||
response = requests.get('http://172.16.10.10:8081/upload') | ||
assert response.ok | ||
assert 'Upload any image!' in response.text | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import requests | ||
|
||
def test_wordpress_accessible(): | ||
response = requests.get('http://172.16.10.12') | ||
assert response.ok | ||
assert 'ACME Impact Alliance' in response.text |