test: clean obsolete executable fixtures and CI hooks

This commit is contained in:
Autumn (Bee) committed 2026-10-01 18:03:53 +09:00
1 parent 7446a42e56
commit 6dda2d37ba
11 files changed
+15 -80

No files matched your search

-4
View File
@@ -18,10 +18,6 @@ script:
- cargo build
- cargo test
- cargo fmt -- --check
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- "./send.sh failure $WEBHOOK_URL"
after_success: |
if [ -n "${GITHUB_TOKEN}" ]; then
[ "${TRAVIS_BRANCH} " = master ] &&
+3 -5
View File
@@ -1,7 +1,5 @@
# Dockerfile for RustScan development environment
# Provides a containerized setup with Rust, nmap, and development tools
# Provides a containerized setup with Rust and development tools
FROM rust
# Install nmap first.
RUN apt-get update -qy && apt-get install -qy nmap
# Then install rustfmt for code formatting and clippy for linting.
RUN rustup component add rustfmt clippy
# Install rustfmt for code formatting and clippy for linting.
RUN rustup component add rustfmt clippy
+2 -2
View File
@@ -54,10 +54,10 @@ You can now modify RustScan files with your favorite editor, once you want to co
root@container:/rustscan# cargo build
```
You are now ready to use RustScan:
You can check the command-line interface without starting a scan:
```bash
root@container:/rustscan# cargo run -- -b 2000 -t 5000 -a 127.0.0.1
root@container:/rustscan# cargo run -- --help
```
You can also format, lint with `clippy` and test the code with the following commands:
-23
View File
@@ -1,23 +0,0 @@
#!/usr/bin/perl
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "perl {{script}} {{ip}} {{port}}"
# The Scriptfile parser stops parsing at the first blank line.
# This script will run itself as an argument with the system installed perl interpreter, ports will be concatenated with "," .
# Unused field: trigger_port = "80"
# get total arg passed to this script
my $total = $#ARGV + 1;
my $counter = 1;
# get script name
my $scriptname = $0;
print "Total args passed to $scriptname : $total\n";
# Use loop to print all args stored in an array called @ARGV
foreach my $a(@ARGV) {
print "Arg # $counter : $a\n";
$counter++;
}
-13
View File
@@ -1,13 +0,0 @@
#!/usr/bin/python3
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#trigger_port = "80"
#call_format = "python3 {{script}} {{ip}} {{port}}"
# The Scriptfile parser stops parsing at the first blank line.
# This script will run itself as an argument with the system installed python interpreter, only scanning port 80.
# Unused filed: ports_separator = ","
import sys
print('Python script ran with arguments', str(sys.argv))
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "bash {{script}} {{ip}} {{port}}"
# The Scriptfile parser stops parsing at the first blank line.
# This script will run itself as an argument with the system installed bash interpreter, scanning all ports concatenated with "," .
# Unused filed: trigger_port = "80"
# print all arguments passed to the script
echo $@
+3 -5
View File
@@ -1,9 +1,7 @@
#!intentional_blank_line
Metadata-only test fixture; not executable.
#tags = ["core_approved", "example"]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "nmap -vvv -p {{port}} {{ip}}"
#call_format = "fixture {{ip}} {{port}}"
# The Scriptfile parser stops parsing at the first blank line.
# This script will run the system installed nmap, ports will be concatenated with "," .
# Unused field: trigger_port = "80"
The parser reads only the metadata above. This file contains no script body.
@@ -1,7 +1,7 @@
#!intentional_blank_line
Metadata-only test fixture; not executable.
#tags = "core_approved"
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "nmap -vvv -p {{port}} {{ip}}"
#call_format = "fixture {{ip}} {{port}}"
# tags has to be an array, thus this file won't be parsed
# tags has to be an array, thus this file won't be parsed
View File
Whitespace-only changes.
-6
View File
@@ -1,6 +0,0 @@
127.0.0.1
google.com
example.com
66666666666666.666666666666666666.66666666666666666.6666666666
....
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.radiatorFixtures
+4 -7
View File
@@ -46,12 +46,9 @@
//!
//! - `fixtures/test_rustscan_scripts.toml`
//!
//! Script file examples:
//! Metadata-only test fixture:
//!
//! - `fixtures/test_script.py`
//! - `fixtures/test_script.pl`
//! - `fixtures/test_script.sh`
//! - `fixtures/test_script.txt`
//! - `fixtures/.rustscan_scripts/test_script.txt`
//!
//! `call_format` in script files can be of 2 variants:
//!
@@ -410,7 +407,7 @@ mod tests {
fn find_and_parse_scripts() {
let scripts = find_scripts("fixtures/.rustscan_scripts".into()).unwrap();
let scripts = parse_scripts(scripts);
assert_eq!(scripts.len(), 4);
assert_eq!(scripts.len(), 1);
}
#[test]
@@ -450,7 +447,7 @@ mod tests {
assert_eq!(script_f.ports_separator, Some(",".to_string()));
assert_eq!(
script_f.call_format,
Some("nmap -vvv -p {{port}} {{ip}}".to_string())
Some("fixture {{ip}} {{port}}".to_string())
);
}