Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoketest #8

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/helm-build-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches: [main]
workflow_dispatch:

env:
API_KEY: changeme
OPENVASD: 127.0.0.1:8080

jobs:
openvasd:
runs-on: ubuntu-latest
Expand All @@ -21,12 +25,24 @@ jobs:
helm uninstall openvasd || true
helm install openvasd charts/openvasd/ --values charts/openvasd/values.yaml
kubectl rollout status --watch --timeout 600s deployment/openvasd
helm test openvasd
sleep 5
#helm test openvasd
- id: smoketest
run: echo "POD_NAME=$(kubectl get pods |grep openvasd | awk '{print $1;}')" >> $GITHUB_OUTPUT
- name: forward port
run: |
echo "POD_NAME: ${{ steps.smoketest.outputs.POD_NAME }}"
echo "$(kubectl get pods)"
#kubectl --namespace default port-forward ${{ steps.smoketest.outputs.POD_NAME }} 8080:3000 &
- name: smoketest
working-directory: rust/smoketest
run: |
make build run
- uses: greenbone/actions/helm-build-push@v3
if: github.event_name == 'workflow_dispatch'
with:
chart-name: openvasd
registry: ${{ vars.IMAGE_REGISTRY }}
registry-subpath: helm-charts/
registry-user: ${{ secrets.GREENBONE_BOT }}
registry-token: ${{ secrets.GREENBONE_BOT_PACKAGES_WRITE_TOKEN }}
registry-token: ${{ secrets.GREENBONE_BOT_PACKAGES_WRITE_TOKEN }}
155 changes: 134 additions & 21 deletions rust/Cargo.lock

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

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ members = [
"osp",
"openvasd",
"scanconfig",
"smoketest",
]
4 changes: 2 additions & 2 deletions rust/models/src/host_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ pub struct HostInfo {
pub finished: u32,
#[cfg_attr(
feature = "serde_support",
serde(skip_serializing_if = "Vec::is_empty")
serde(skip_serializing_if = "Option::is_none")
)]
/// IPs of hosts, that are currently scanned.
pub scanning: Vec<String>,
pub scanning: Option<Vec<String>>,
}
2 changes: 1 addition & 1 deletion rust/osp/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ impl From<Scan> for models::Status {
- i.count_alive.content.0
- i.host.len() as u32,
finished: i.count_alive.content.0,
scanning,
scanning: Some(scanning),
}),
}
}
Expand Down
23 changes: 23 additions & 0 deletions rust/smoketest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "smoketest"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
models = {path = "../models"}
clap = { version = "4.4.0", features = ["derive"] }
reqwest = { version = "0.11.20", features = ["rustls-tls", "blocking", "json"], default-features=false }
tokio = { version = "1.32.0", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
serde = {version = "1", features = ["derive"], optional = true}
serde_json = "1"

[features]
default = ["serde_support"]
serde_support = ["serde"]

[dev-dependencies]
serde_json = "1"
Loading
Loading