Skip to content

Commit 4579c5c

Browse files
Added names for individual unit tests, added additional tests for some endpoints
1 parent 8ebdaa2 commit 4579c5c

43 files changed

Lines changed: 592 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/test_api_v1_services_restart.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
class APIUnitTestServicesRestart(unit_test_framework.APIUnitTest):
1818
url = "/api/v1/services/restart"
1919
post_tests = [
20-
{"resp_time": 15} # Allow up to 15 seconds for all services to restart
20+
{
21+
"name": "Restart all services",
22+
"resp_time": 15 # Allow up to 15 seconds for all services to restart
23+
}
2124
]
2225

2326
APIUnitTestServicesRestart()

tests/test_api_v1_services_sshd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
class APIUnitTestServicesSSHd(unit_test_framework.APIUnitTest):
1818
url = "/api/v1/services/sshd"
19-
get_tests = [{}]
19+
get_tests = [{"name": "Read SSHd configuration"}]
2020
put_tests = [
2121
{
22+
"name": "Update and disable SSHd",
2223
"payload": {
2324
"enable": False,
2425
"sshdkeyonly": "both",
@@ -27,6 +28,7 @@ class APIUnitTestServicesSSHd(unit_test_framework.APIUnitTest):
2728
}
2829
},
2930
{
31+
"name": "Update and enabled SSHd",
3032
"payload": {
3133
"enable": True,
3234
"sshdkeyonly": "disabled",

tests/test_api_v1_services_sshd_restart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
class APIUnitTestServicesSSHdRestart(unit_test_framework.APIUnitTest):
1818
url = "/api/v1/services/sshd/restart"
19-
post_tests = [{}]
19+
post_tests = [{"name": "Restart the SSHd service"}]
2020

2121
APIUnitTestServicesSSHdRestart()

tests/test_api_v1_services_sshd_start.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesSSHdStart(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/sshd/start"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Start the SSHd service"}]
21+
2022

21-
APIUnitTestServicesSSHdStart()
23+
APIUnitTestServicesSSHdStart()

tests/test_api_v1_services_sshd_stop.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesSSHdStop(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/sshd/stop"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Stop the SSHd service"}]
21+
2022

21-
APIUnitTestServicesSSHdStop()
23+
APIUnitTestServicesSSHdStop()

tests/test_api_v1_services_start.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesStart(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/start"
1920
post_tests = [
20-
{"resp_time": 10}
21+
{
22+
"name": "Start all services",
23+
"resp_time": 10
24+
}
2125
]
2226

23-
APIUnitTestServicesStart()
27+
28+
APIUnitTestServicesStart()

tests/test_api_v1_services_stop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesStop(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/stop"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Stop all services"}]
21+
2022

2123
APIUnitTestServicesStop()

tests/test_api_v1_services_syslogd_restart.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesSyslogdRestart(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/syslogd/restart"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Restart the syslogd service"}]
21+
2022

2123
APIUnitTestServicesSyslogdRestart()

tests/test_api_v1_services_syslogd_start.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesSyslogdStart(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/syslogd/start"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Start the syslogd service"}]
21+
2022

21-
APIUnitTestServicesSyslogdStart()
23+
APIUnitTestServicesSyslogdStart()

tests/test_api_v1_services_syslogd_stop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import unit_test_framework
1616

17+
1718
class APIUnitTestServicesSyslogdStop(unit_test_framework.APIUnitTest):
1819
url = "/api/v1/services/syslogd/stop"
19-
post_tests = [{}]
20+
post_tests = [{"name": "Stop the syslogd service"}]
21+
2022

2123
APIUnitTestServicesSyslogdStop()

0 commit comments

Comments
 (0)