Skip to content

Commit

Permalink
Merge pull request 5GSEC#106 from VedRatan/issue_93
Browse files Browse the repository at this point in the history
[test]: added chainsaw tests for nimbus-kyverno-adapter
  • Loading branch information
anurag-rajawat authored May 3, 2024
2 parents 0f69a67 + 3b1d0f9 commit 5bd2740
Show file tree
Hide file tree
Showing 22 changed files with 871 additions and 297 deletions.
69 changes: 36 additions & 33 deletions tests/controllers/nimbuspolicy/delete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,65 @@
This test validates that when a NimbusPolicy is directly deleted, nimbus automatically re-creates the deleted NimbusPolicy or not.


### Steps
## Steps

| # | Name | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 1 | 0 | 0 |
| 4 | [Delete existing NimbusPolicy](#step-Delete existing NimbusPolicy) | 1 | 0 | 0 |
| 5 | [Verify NimbusPolicy recreation](#step-Verify NimbusPolicy recreation) | 1 | 0 | 0 |
| # | Name | Bindings | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 0 | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 0 | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 0 | 1 | 0 | 0 |
| 4 | [Delete existing NimbusPolicy](#step-Delete existing NimbusPolicy) | 0 | 1 | 0 | 0 |
| 5 | [Verify NimbusPolicy recreation](#step-Verify NimbusPolicy recreation) | 0 | 1 | 0 | 0 |

## Step: `Create a SecurityIntent`
### Step: `Create a SecurityIntent`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Create a SecurityIntentBinding`
### Step: `Create a SecurityIntentBinding`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Verity NimbusPolicy creation`
### Step: `Verity NimbusPolicy creation`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

## Step: `Delete existing NimbusPolicy`
### Step: `Delete existing NimbusPolicy`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `delete` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `delete` | 0 | 0 | *No description* |

## Step: `Verify NimbusPolicy recreation`
### Step: `Verify NimbusPolicy recreation`

*No description*

### Try
#### Try

| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

---

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
69 changes: 36 additions & 33 deletions tests/controllers/nimbuspolicy/update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,65 @@
This test validates that direct updates to a NimbusPolicy resource are ignored, to maintain consistency and prevent unintended modifications.


### Steps
## Steps

| # | Name | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 1 | 0 | 0 |
| 4 | [Update existing NimbusPolicy](#step-Update existing NimbusPolicy) | 1 | 0 | 0 |
| 5 | [Verify discarding of changes to NimbusPolicy](#step-Verify discarding of changes to NimbusPolicy) | 1 | 0 | 0 |
| # | Name | Bindings | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 0 | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 0 | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 0 | 1 | 0 | 0 |
| 4 | [Update existing NimbusPolicy](#step-Update existing NimbusPolicy) | 0 | 1 | 0 | 0 |
| 5 | [Verify discarding of changes to NimbusPolicy](#step-Verify discarding of changes to NimbusPolicy) | 0 | 1 | 0 | 0 |

## Step: `Create a SecurityIntent`
### Step: `Create a SecurityIntent`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Create a SecurityIntentBinding`
### Step: `Create a SecurityIntentBinding`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Verity NimbusPolicy creation`
### Step: `Verity NimbusPolicy creation`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

## Step: `Update existing NimbusPolicy`
### Step: `Update existing NimbusPolicy`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Verify discarding of changes to NimbusPolicy`
### Step: `Verify discarding of changes to NimbusPolicy`

*No description*

### Try
#### Try

| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

---

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
33 changes: 18 additions & 15 deletions tests/controllers/securityintent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,32 @@
This test validates that the created SecurityIntent status subresource contains the ID and action fields with the corresponding intent values.


### Steps
## Steps

| # | Name | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 1 | 0 | 0 |
| 2 | [Verify status of created SecurityIntent](#step-Verify status of created SecurityIntent) | 1 | 0 | 0 |
| # | Name | Bindings | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 0 | 1 | 0 | 0 |
| 2 | [Verify status of created SecurityIntent](#step-Verify status of created SecurityIntent) | 0 | 1 | 0 | 0 |

## Step: `Create a SecurityIntent`
### Step: `Create a SecurityIntent`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Verify status of created SecurityIntent`
### Step: `Verify status of created SecurityIntent`

*No description*

### Try
#### Try

| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

---

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
69 changes: 36 additions & 33 deletions tests/controllers/securityintentbinding/create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,66 @@
This test validates the automated creation of a NimbusPolicy resource when a corresponding SecurityIntent and SecurityIntentBinding are created.


### Steps
## Steps

| # | Name | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 1 | 0 | 0 |
| 4 | [Verify status of created SecurityIntentBinding](#step-Verify status of created SecurityIntentBinding) | 1 | 0 | 0 |
| 5 | [Verify status of created NimbusPolicy](#step-Verify status of created NimbusPolicy) | 1 | 0 | 0 |
| # | Name | Bindings | Try | Catch | Finally |
|:-:|---|:-:|:-:|:-:|:-:|
| 1 | [Create a SecurityIntent](#step-Create a SecurityIntent) | 0 | 1 | 0 | 0 |
| 2 | [Create a SecurityIntentBinding](#step-Create a SecurityIntentBinding) | 0 | 1 | 0 | 0 |
| 3 | [Verity NimbusPolicy creation](#step-Verity NimbusPolicy creation) | 0 | 1 | 0 | 0 |
| 4 | [Verify status of created SecurityIntentBinding](#step-Verify status of created SecurityIntentBinding) | 0 | 1 | 0 | 0 |
| 5 | [Verify status of created NimbusPolicy](#step-Verify status of created NimbusPolicy) | 0 | 1 | 0 | 0 |

## Step: `Create a SecurityIntent`
### Step: `Create a SecurityIntent`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Create a SecurityIntentBinding`
### Step: `Create a SecurityIntentBinding`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `apply` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |

## Step: `Verity NimbusPolicy creation`
### Step: `Verity NimbusPolicy creation`

*No description*

### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

## Step: `Verify status of created SecurityIntentBinding`
### Step: `Verify status of created SecurityIntentBinding`

Verify the created SecurityIntentBinding status subresource includes the number and names of bound intents, along with the generated NimbusPolicy name.


### Try
#### Try

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

## Step: `Verify status of created NimbusPolicy`
### Step: `Verify status of created NimbusPolicy`

*No description*

### Try
#### Try

| # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---|
| 1 | `assert` | 0 | 0 | *No description* |

---

| # | Operation | Description |
|:-:|---|---|
| 1 | `assert` | *No description* |
Loading

0 comments on commit 5bd2740

Please sign in to comment.