Skip to content

Commit

Permalink
Release v0.0.4
Browse files Browse the repository at this point in the history
Bump version
Update documentation
Update tests
Apply code style suggestions
Update copyright year
  • Loading branch information
sonertari committed Sep 25, 2021
1 parent 488ccaf commit 8825329
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "testproxy"
description = "Tool for end-to-end testing of proxy servers"
repository = "https://github.com/sonertari/TestProxy"
homepage = "https://github.com/sonertari/TestProxy"
version = "0.0.3"
version = "0.0.4"
authors = ["Soner Tari <[email protected]>"]
keywords = ["testproxy", "testing", "proxy", "end-to-end"]
categories = ["development-tools::testing", "network-programming", "command-line-utilities"]
Expand All @@ -19,7 +19,7 @@ colored = "1.7.0"
log = "0.4.6"
fern = { version = "0.5.8", features = ["colored"] }
serde_json = "1.0.39"
serde = {version = "1.0.90", features = ["derive"] }
serde = { version = "1.0.90", features = ["derive"] }
chrono = "0.4.7"
regex = "1.1.7"

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Version](https://img.shields.io/crates/v/testproxy.svg)](https://crates.io/crates/testproxy)
[![Build Status](https://travis-ci.org/sonertari/TestProxy.svg?branch=master)](https://travis-ci.org/sonertari/TestProxy)

Copyright (C) 2019, 2020, [Soner Tari](http://comixwall.org).
Copyright (C) 2019-2021, [Soner Tari](https://github.com/sonertari).
https://github.com/sonertari/TestProxy

## Overview
Expand All @@ -19,6 +19,10 @@ thread to run the tests, and in turn the manager thread starts a client and a
server thread for each test. The manager sends commands to these client/server
pairs to execute the tests it is started for.

The [SSLproxy](https://github.com/sonertari/SSLproxy) project uses TestProxy
in its end-to-end tests. See the testproxy test sets in the SSLproxy sources
to learn how to use TestProxy.

![Operation Diagram](examples/OperationDiagram.png)

TestProxy test steps are composed of a test end, a command, and a payload. For
Expand Down
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down
2 changes: 1 addition & 1 deletion src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down
2 changes: 1 addition & 1 deletion src/manager.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down Expand Up @@ -59,7 +59,7 @@ impl Server {
fn run_tcp(&mut self, tcp_stream: &TcpStream, failed: &mut bool) -> bool {
self.base.cmd_trials = 0;
loop {
if self.base.prev_cmd == Command::Reconnect {
if self.base.prev_cmd == Command::Reconnect {
debug!(target: &self.base.name, "Executing Reconnect command");
self.base.prev_cmd = Command::None;
break false;
Expand Down Expand Up @@ -154,7 +154,7 @@ impl Server {
if let Ok(mut ssl_stream) = ssl_stream_result {
self.base.cmd_trials = 0;
exit = loop {
if self.base.prev_cmd == Command::Reconnect {
if self.base.prev_cmd == Command::Reconnect {
debug!(target: &self.base.name, "Executing Reconnect command");
self.base.prev_cmd = Command::None;
break false;
Expand Down
5 changes: 4 additions & 1 deletion src/testend.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019, 2020 Soner Tari <[email protected]>
// Copyright (C) 2019-2021 Soner Tari <[email protected]>
//
// This file is part of TestProxy.
//
Expand Down Expand Up @@ -970,6 +970,7 @@ pub mod tests {
assert_eq!(format!("{}", Command::Recv), "recv");
assert_eq!(format!("{}", Command::SslConnectFail), "sslconnectfail");
assert_eq!(format!("{}", Command::Timeout), "timeout");
assert_eq!(format!("{}", Command::Reconnect), "reconnect");
assert_eq!(format!("{}", Command::Quit), "quit");
assert_eq!(format!("{}", Command::Fail), "fail");
assert_eq!(format!("{}", Command::KeepAlive), "keepalive");
Expand All @@ -980,6 +981,7 @@ pub mod tests {
assert_eq!(Command::from_str("recv").unwrap(), Command::Recv);
assert_eq!(Command::from_str("sslconnectfail").unwrap(), Command::SslConnectFail);
assert_eq!(Command::from_str("timeout").unwrap(), Command::Timeout);
assert_eq!(Command::from_str("reconnect").unwrap(), Command::Reconnect);
}

#[test]
Expand All @@ -988,6 +990,7 @@ pub mod tests {
assert_eq!(Command::Recv.is_action_command(), true);
assert_eq!(Command::SslConnectFail.is_action_command(), true);
assert_eq!(Command::Timeout.is_action_command(), true);
assert_eq!(Command::Reconnect.is_action_command(), false);
assert_eq!(Command::Quit.is_action_command(), false);
assert_eq!(Command::Fail.is_action_command(), false);
assert_eq!(Command::KeepAlive.is_action_command(), false);
Expand Down

0 comments on commit 8825329

Please sign in to comment.