A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

Overview

HTTP Server Tester

This is a CLI test program for HNU Cloud Computing Lab 2.

Install

For most student, you don't neet to rebuild this project.

We provide the release versions for main platforms.

Check your OS & goto Release Page to download the correct zip.

If you cannot find the target zip, or the binary file cannot execute correctly, check build introduction.

Unzip it, then you can find 2 folders: config/ & files/, and 1 binary file: http-server-tester.

Move the whole program folder to anywhere you like, but DON'T CHANGE the relative path between files.

Use

ATTENTION: Note that, unless otherwise specified, all relative paths of tester are relative to the directory where you execute ./http-server-tester.

Configure

There are 2 files in config/: tester-config.json & log-config.yaml.

tester-config.json defines commands and test items of the test program.

log-config.yaml defines how to output to the console & the log file.

What you need to do first is to modify the values of this keys in tester-config.json:

  • directory The directroy of your project,
  • build The command you compile your project,
  • clean The command you clean your project,
  • bin The command you run your project,
  • server The arguments for running your HTTP server.

For example:

{
    "directory": "/home/user/projects/http-server",
    "build": "make",
    "clean": "make clean",
    "bin": "./http-server",
    "server": {
        "ip": "127.0.0.1",
        "port": 8080,
        "threads": 8
    },
    ...
}

ATTENTION: bin is relative to directory.

It's better to use absolute path for the key directory. Relative path is OK, but don't use environment variables like $HOME or ~.

If you want to pass build or clean, just use a empty string "".

For server.ip, use "127.0.0.1" instead of "localhost". Because ab don't support it.

Tester will go to /home/user/projects/http-server and run the command ./http-server --ip 127.0.0.1 --port 8080 --threads 8.

If you don't understand how the meanings of keys, check Configure Tester.

Check Tools & Files

Install curl , netcat(nc) & apache bench(ab), they are tools that will be called.

Files in the directory ./files/ will be compared with the HTTP response during testing.

They are specified in ./config/tester-config.json.

Run

There are some subcommands, your most commonly used subcommand should be run.

It has a argument mode, use --mode basic or --mode advanced to select tester work mode.

For example:

user@linux:~/http-server-tester$ ./http-server-tester run --mode advancd

Use run subcommand, tester will check curl, nc & ab tools , rebuild your projects, run your HTTP server and send requests to test.

You can also use other subcommands, like build, dev, to help you to develop the server.

The different from run & dev is that dev subcommand won't rebuild your projects or try to run your HTTP server.

The build part will not print any messages unless it builds failed.

The output of your server will be printed to the console, but not the log file.

Use http-server-tester --help for more help information.

user@linux:~/http-server-tester$ ./http-server-tester --help
http-server-tester x.x.x
IceyBlackTea <[email protected]>
A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

USAGE:
    http-server-tester <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    build    Build the http server
    check    Check if tools have been installed
    clean    Clean the project directory
    dev      Test the running http server
    help     Print this message or the help of the given subcommand(s)
    run      Test the http server including rebuilding and starting

Check Results

The output will be shown in console & be stored in the log file ./logs/tester.log.

It will show the log level & messages.

You just need to pay attention to info and error levels.

For example:

user@linux:~/http-server-tester$ ./http-server-tester run --mode advancd
...
[WARN ] Trying to kill the HTTP Server...
[TRACE] The HTTP Server is stopped.
[INFO ] -------TESTER RESULTS------
[ERROR] HTTP test items: all 6, passes 3
[INFO ] Pipelining test items: all 2, passes 2
[ERROR] Proxy test items: all 2, passes 0
[INFO ] Perfermance test 1 times.
[INFO ] No.1: requests 100, concurrency 10, reqs/s 9273, time/req 0.108
[INFO ] -------TESTER RESULTS------

Sorry, the log file will be replaced if you rerun tester.

Build

You need to install Rust toolchains.

In the http-serve-teseter/, cargo build --release for release version.

The excutable file will be generated in ./target/realse/.

Rust is hard but interesting. ๐Ÿ˜˜

More

Configure Tester

tester-config.json

It is a JSON file, so please pay attention to the format when you modify it.

If you are not familiar with JSON, check background.md of Lab 2.

It's a bit long, so please read it carefully.

root
key value type description
directroy String The directroy of your project
build String The command you compile your project
clean String The command you clean your project
bin String The command you run your project
server Object The arguments for running your HTTP server
items Object Test items
server
key value type description
ip String The IP your server tend to bind
port Integer The port your server tend to bind
threads Integer The number of threads your server tend to use
items
key value type description
wait_seconds integer The time for the tester to wait for your server to start
basic / advanced Object Test items of basic / advanced version

You can extend the waiting time appropriately if testing always starts before your server startups completely.

basic & advanced
key value type description
get Array Specific test items for GET
post Array Specific test items for POST
pipelining Array Specific test items for pipelining feature
prxoy Array Specific test items for proxy feature
performance Array Specific test items for perfermance

pipelining, proxy & performance are only tested in advanced version.

  • get[i]

    • path: The url path that curl will request.
    • file: The file path of the correct result that will be compared with the response.
  • post[i]

    • path: The url path that curl will request.
    • payload: The file path of the payload that will be sent with the request.
    • file: The file path of the correct result that will be compared with the response.
  • pipelining[i]

    • A array contains paths that needs to access in one requests.
  • proxy[i]

    • host: The proxy remote HTTP server.
    • paths: The array of url path that would be tested.
  • perfromance[i]

    • path: The url path that ab will request.
    • requests: The -n argument of ab, number of requests to perform.
    • concurrency: The -c argument of ab, number of multiple requests to make at a time.

If you modify the items, don't forget to move the correct file into files/.

log-config.yaml

If you modify the file incorrectly, the output format may be wrong, please try not to modify.

I use log4rs to print log messages & generate log files.

For more infomation, you can check docs of log4rs.

Why use Rust?

Just like it. ๐Ÿ˜Ž Rust YYDS.

If you have any problems about this program, please write a issue.

You might also like...
Simple test server for hyperium/h3

Simple test server for hyperium/h3. Serves files with HTTP/3, as well as HTTP/2 and HTTP/1.1 so you can make your browser run HTTP/3 request when it a

ใ€Œ๐Ÿงฑใ€Test a list of payloads and see if you can bypass it
ใ€Œ๐Ÿงฑใ€Test a list of payloads and see if you can bypass it

ใ€Œ ๐Ÿงฑ ใ€About TTWAF TTWAF, or Test This WAF, is a Web Application Firewall (WAF) bypass testing tool. You can test a list of payloads like XSS, LFI, RCE

pam-send-slack-message is a program that publishes messages on slack when a linux server is accessed through ssh.

pam-send-slack-message pam-send-slack-message is a program that publishes messages on slack when the linux server is accessed through ssh. Installatio

The gRPC library for Rust built on C Core library and futures

gRPC-rs gRPC-rs is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first. Sta

A multiplayer web based roguelike built on Rust and WebRTC
A multiplayer web based roguelike built on Rust and WebRTC

Gorgon A multiplayer web-based roguelike build on Rust and WebRTC. License This project is licensed under either of Apache License, Version 2.0, (LICE

Revolt backend API server, built with Rust.

Delta Description Delta is a blazing fast API server built with Rust for Revolt. Features: Robust and efficient API routes for running a chat platform

An easy-to-use tunnel to localhost built in Rust. An alternative to ngrok and frp.

rslocal English | ไธญๆ–‡ What is rslocal? Rslocal is like ngrok built in Rust, it builds a tunnel to localhost. Project status support http support tcp su

STAC server, built in Rust, backed by pgstac

stac-server-rs A simple STAC server written in Rust. To run an example server: stac-server 0.0.0.0:3000 example-config.toml --href data/joplin/collect

The true next-gen L7 minecraft proxy and load balancer. Built in Rust.

Lure The true next-gen L7 minecraft proxy and load balancer. Built in Rust, Tokio and Valence. Why? Rust is a powerful programming language and a grea

Releases(v1.0.6-alpha)
  • v1.0.6-alpha(Apr 20, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • ๐Ÿ’ฉ ๐Ÿ› Fix a bug of restarting the server too fast that the port may still be bound.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.5(Apr 17, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • ๐Ÿ› Fix a critical bug of sending requests with curl, which may causes a error when try to send with query string.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.4(Apr 17, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • ๐Ÿ› Fix a critical bug of reading config file, which may causes a error when try to run the HTTP server.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.3(Apr 2, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • ๐Ÿ› Fix a critical bug of pipe, which may causes incorrect test results.
    • ๐ŸŽจ Update codes of error handling.
    • ๐ŸŽจ Update some output formats.
    • ๐Ÿ“„ Update docs.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.2(Apr 1, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • Add max connect timeout (5s) for curl.
    • Fix some output bugs.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.01 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.1(Apr 1, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    Changlog:

    • Fix some output bugs.
    • Update README.md.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-mac-m1.zip(1.09 MB)
  • v1.0.0(Mar 31, 2022)

    A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

    Basic Feature:

    • Test the HTTP Server if it can handle GET & POST requests & send responses.
    • Test the HTTP Server if it supports the feature of HTTP pipelining.
    • Test the HTTP Server if it supports the feature of proxy.
    • Test the performance of the HTTP Server.

    I use some unix commands, so there will not be any windows zips.

    Source code(tar.gz)
    Source code(zip)
    tester-linux-x64.zip(2.00 MB)
    tester-macos-m1.zip(1.09 MB)
Owner
null
An End-to-End Privacy Computing Protocol on Layer 2

Eigen Network Eigen Network is an end-to-end privacy computation network for a better digital economy based on hybrid privacy computation protocols an

Eigen Lab 24 Oct 13, 2022
Rust client for NATS, the cloud native messaging system.

A Rust client for the NATS messaging system. Status Motivation Rust may be the most interesting new language the NATS ecosystem has seen. We believe t

NATS - The Cloud Native Messaging System 651 Jan 3, 2023
A rust client and structures to interact with the Clever-Cloud API.

Clever-Cloud Software Development Kit - Rust edition This crate provides structures and client to interact with the Clever-Cloud API. Status This crat

Clever Cloud 6 Jun 3, 2022
A library-first, lightweight, high-performance, cloud-native supported API gateway๐Ÿช by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
Filen.io is a cloud storage provider with an open-source desktop client.

Library to call Filen.io API from Rust Filen.io is a cloud storage provider with an open-source desktop client. My goal is to write a library which ca

Konstantin Zakharov 5 Nov 15, 2022
A wrapper for the Google Cloud DNS API

cloud-dns is a crate providing a client to interact with Google Cloud DNS v1

Embark 5 May 24, 2022
๐Ÿ“Š Collect cloud usage data, so that it can be combined with impact data of Boavizta API.

cloud-scanner Collect aws cloud usage data, so that it can be combined with impact data of Boavizta API. โš  Very early Work in progress ! At the moment

Boavizta 10 Dec 7, 2022
Cloud Native high performance security and privacy SQL proxy.

Fern proxy With the advent of Cloud Native applications, architecture patterns evolved and emerged to take advantage of cloud computing, and build mor

Fern 12 Nov 7, 2022
Simple project to test grpc between ruby (client) and rust (server)

grpc-example Simple project to test grpc between ruby (client) and rust (server). Usage To simplify a lot this project uses docker and docker compose

Bruno Arueira 2 Oct 14, 2021
Test the interception/filter of UDP 53 of your local networks or hotspots.

udp53_lookup Test the interception/filter of UDP 53 of your local networks or hotspots. Inspired by BennyThink/UDP53-Filter-Type . What's the purpose?

null 1 Dec 6, 2021