mirror of
https://github.com/qilingframework/qiling.git
synced 2026-10-12 02:21:40 +00:00
arm httpd test
This commit is contained in:
+1
-1
Submodule examples/rootfs updated: 7a610d6618...3f6aa4bc9d
@@ -14,6 +14,14 @@
|
||||
|
||||
#define CONNMAX 1000
|
||||
|
||||
char *method, // "GET" or "POST"
|
||||
*uri, // "/index.html" things before '?'
|
||||
*qs, // "a=1&b=2" things after '?'
|
||||
*prot; // "HTTP/1.1"
|
||||
|
||||
char *payload; // for POST
|
||||
int payload_size;
|
||||
|
||||
static int listenfd, clients[CONNMAX];
|
||||
static void error(char *);
|
||||
static void startServer(const char *);
|
||||
|
||||
@@ -10,13 +10,13 @@ void serve_forever(const char *PORT);
|
||||
|
||||
// Client request
|
||||
|
||||
char *method, // "GET" or "POST"
|
||||
extern char *method, // "GET" or "POST"
|
||||
*uri, // "/index.html" things before '?'
|
||||
*qs, // "a=1&b=2" things after '?'
|
||||
*prot; // "HTTP/1.1"
|
||||
|
||||
char *payload; // for POST
|
||||
int payload_size;
|
||||
extern char *payload; // for POST
|
||||
extern int payload_size;
|
||||
|
||||
char *request_header(const char* name);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "httpd.h"
|
||||
|
||||
int main(int c, char** v)
|
||||
int main(int c, char** v, int argc, const char **argv)
|
||||
{
|
||||
serve_forever("12913");
|
||||
return 0;
|
||||
|
||||
@@ -296,6 +296,20 @@ class ELFTest(unittest.TestCase):
|
||||
f = os.popen("curl http://127.0.0.1:12913")
|
||||
self.assertEqual("httpd_test_successful", f.read())
|
||||
|
||||
def test_http_elf_linux_arm(self):
|
||||
def picohttpd():
|
||||
ql = Qiling(["../examples/rootfs/arm_linux/bin/picohttpd"], "../examples/rootfs/arm_linux", multithread=True, verbose=QL_VERBOSE.DEBUG)
|
||||
ql.run()
|
||||
|
||||
|
||||
picohttpd_therad = threading.Thread(target=picohttpd, daemon=True)
|
||||
picohttpd_therad.start()
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
f = os.popen("curl http://127.0.0.1:12913")
|
||||
self.assertEqual("httpd_test_successful", f.read())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user