-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcommon.rs
More file actions
136 lines (114 loc) · 3.66 KB
/
Copy pathcommon.rs
File metadata and controls
136 lines (114 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
use crate::common::nrql::Region;
use std::path::PathBuf;
pub mod cert;
pub mod config;
pub mod docker_hub;
pub mod exec;
pub mod file;
pub mod fleet_control_api;
pub mod logs;
pub mod nrql;
pub mod oci;
pub mod on_drop;
pub mod runtime;
pub mod test;
/// Common Fleet Control arguments shared across different commands
#[derive(Debug, Clone, clap::Parser)]
pub struct FleetControlArgs {
/// Fleet ID for Fleet Control tests
#[arg(long)]
pub fleet_id: String,
/// Fleet Control authentication token
#[arg(long)]
pub fleet_control_token: String,
/// Test tags to include when filtering which tests to run (e.g. FLEET_DEPLOYMENT_REMOTE),
/// can be specified multiple times
#[arg(long = "include-test-tag")]
pub include_test_tags: Vec<String>,
/// Test scenario names to run (e.g. ManagedEntityIsConnectedRemote),
/// can be specified multiple times
#[arg(long = "test-scenario")]
pub test_scenarios: Vec<String>,
}
/// Arguments for scenarios that require Agent Control installation
#[derive(Default, Debug, Clone, clap::Parser)]
pub struct InstallationArgs {
/// Folder where packages are stored
#[arg(long)]
pub artifacts_package_dir: Option<PathBuf>,
/// Recipes repository
#[arg(
long,
default_value = "https://github.com/newrelic/open-install-library.git"
)]
pub recipes_repo: String,
/// Recipes repository branch
#[arg(long, default_value = "main")]
pub recipes_repo_branch: String,
/// New Relic API key for programmatic access to New Relic services
#[arg(long)]
pub nr_api_key: String,
/// New Relic license key for agent authentication
#[arg(long)]
pub nr_license_key: String,
/// New Relic account identifier for associating the agent
#[arg(long)]
pub nr_account_id: String,
/// System Identity client id
#[arg(long)]
pub system_identity_client_id: String,
/// System Identity private key
#[arg(long)]
pub agent_control_private_key: String,
/// Specific version of agent control to install
#[arg(long)]
pub agent_control_version: String,
/// New Relic region
#[arg(long, ignore_case = true)]
pub nr_region: Region,
/// Version of the infrastructure agent OCI image to use in tests
#[arg(long)]
pub infra_agent_version: Option<String>,
/// Version of the NRDot OCI image to use in tests
#[arg(long)]
pub nrdot_version: Option<String>,
/// Version of the eBPF agent OCI image to use in tests
#[arg(long)]
pub ebpf_agent_version: Option<String>,
}
/// Arguments for Fleet Control scenarios that also install Agent Control
#[derive(Debug, Clone, clap::Parser)]
pub struct FleetControlInstallationArgs {
#[command(flatten)]
pub installation: InstallationArgs,
#[command(flatten)]
pub fleet_control: FleetControlArgs,
}
/// Arguments for Fleet Control API tests that don't require Agent Control installation
#[derive(Debug, Clone, clap::Parser)]
pub struct FleetControlApiArgs {
/// Fleet Control arguments
#[command(flatten)]
pub fleet_control: FleetControlArgs,
}
/// Data to set up installation
pub struct RecipeData {
pub args: InstallationArgs,
pub fleet_id: String,
pub fleet_enabled: bool,
pub recipe_list: String,
pub proxy_url: String,
pub monitoring_source: String,
}
impl Default for RecipeData {
fn default() -> Self {
Self {
args: Default::default(),
fleet_id: Default::default(),
proxy_url: Default::default(),
fleet_enabled: false,
recipe_list: "agent-control".to_string(),
monitoring_source: "infra-agent".to_string(),
}
}
}