Skip to content

[TACACS] Fix TACACS accounting UT issue caused by auditd log rotate.#11710

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
liuh-80:dev/liuh/fix-aaa-auditd
Feb 27, 2024
Merged

[TACACS] Fix TACACS accounting UT issue caused by auditd log rotate.#11710
qiluo-msft merged 1 commit intosonic-net:masterfrom
liuh-80:dev/liuh/fix-aaa-auditd

Conversation

@liuh-80
Copy link
Copy Markdown
Contributor

@liuh-80 liuh-80 commented Feb 18, 2024

Fix TACACS accounting UT issue caused by auditd log rotate

Description of PR

Fix TACACS accounting UT issue caused by auditd log rotate

Work item tracking
  • Microsoft ADO: 26710599

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • [] Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:

  1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
  2. duthost.command() can only run 1 command, so can't handle piping output to grep

How did you do it?

show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

How did you verify/test it?

Pass all UT

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@liuh-80 liuh-80 marked this pull request as ready for review February 19, 2024 05:17
@liuh-80 liuh-80 requested a review from qiluo-msft February 19, 2024 05:17
@qiluo-msft qiluo-msft merged commit b91ccc4 into sonic-net:master Feb 27, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request May 10, 2024
…#11710)

Fix TACACS accounting UT issue caused by auditd log rotate

### Description of PR
Fix TACACS accounting UT issue caused by auditd log rotate

##### Work item tracking
- Microsoft ADO: 26710599

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [] Test case(new/improvement)

## Approach
#### What is the motivation for this PR?
Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:
1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
1. duthost.command() can only run 1 command, so can't handle piping output to grep

#### How did you do it?
show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

#### How did you verify/test it?
Pass all UT
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202305: #12801

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request May 10, 2024
…#11710)

Fix TACACS accounting UT issue caused by auditd log rotate

### Description of PR
Fix TACACS accounting UT issue caused by auditd log rotate

##### Work item tracking
- Microsoft ADO: 26710599

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [] Test case(new/improvement)

## Approach
#### What is the motivation for this PR?
Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:
1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
1. duthost.command() can only run 1 command, so can't handle piping output to grep

#### How did you do it?
show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

#### How did you verify/test it?
Pass all UT
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202311: #12802

mssonicbld pushed a commit that referenced this pull request May 11, 2024
Fix TACACS accounting UT issue caused by auditd log rotate

### Description of PR
Fix TACACS accounting UT issue caused by auditd log rotate

##### Work item tracking
- Microsoft ADO: 26710599

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [] Test case(new/improvement)

## Approach
#### What is the motivation for this PR?
Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:
1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
1. duthost.command() can only run 1 command, so can't handle piping output to grep

#### How did you do it?
show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

#### How did you verify/test it?
Pass all UT
@liuh-80
Copy link
Copy Markdown
Contributor Author

liuh-80 commented May 11, 2024

202305 PR not auto merge, remove and add back again

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request May 11, 2024
…#11710)

Fix TACACS accounting UT issue caused by auditd log rotate

### Description of PR
Fix TACACS accounting UT issue caused by auditd log rotate

##### Work item tracking
- Microsoft ADO: 26710599

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [] Test case(new/improvement)

## Approach
#### What is the motivation for this PR?
Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:
1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
1. duthost.command() can only run 1 command, so can't handle piping output to grep

#### How did you do it?
show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

#### How did you verify/test it?
Pass all UT
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202305: #12823

mssonicbld pushed a commit that referenced this pull request May 11, 2024
Fix TACACS accounting UT issue caused by auditd log rotate

### Description of PR
Fix TACACS accounting UT issue caused by auditd log rotate

##### Work item tracking
- Microsoft ADO: 26710599

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [] Test case(new/improvement)

## Approach
#### What is the motivation for this PR?
Fix TACACS accounting UT issue caused by auditd log rotate.
There are 2 code issue:
1. when auditd log rotate, some auditd log will missing from output of 'service auditd status'
1. duthost.command() can only run 1 command, so can't handle piping output to grep

#### How did you do it?
show auditd log with 'sudo journalctl -u auditd --boot' and run command with duthost.shell() to support grep.

#### How did you verify/test it?
Pass all UT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants