Skip to content

Commit fc8c67c

Browse files
bhcopelandMax Hubmannnmanthey
committed
Initial import of AWS Cloud Labs kernel testing framework
Cloud-based kernel CI testing on AWS EC2 instances using SSM for test execution. Supports UnixBench regression detection, kernel reboot tests, and basic boot validation. Co-authored-by: Max Hubmann <mxhbm@amazon.de> Co-authored-by: Norbert Manthey <nmanthey@amazon.de> Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
0 parents  commit fc8c67c

106 files changed

Lines changed: 11666 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
.venv/
8+
venv/
9+
ENV/
10+
env/
11+
12+
# Git
13+
.git/
14+
.gitignore
15+
.gitattributes
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
23+
# Tests
24+
tests/
25+
*.pytest_cache/
26+
.coverage
27+
htmlcov/
28+
29+
# Documentation
30+
*.md
31+
docs/
32+
33+
# CI/CD
34+
.github/
35+
.pre-commit-config.yaml
36+
37+
# Build artifacts
38+
*.egg-info/
39+
dist/
40+
build/

.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 120
3+
extend-ignore = E203, W503
4+
exclude =
5+
.git,
6+
.venv*,
7+
build,
8+
dist,
9+
__pycache__,
10+
*.egg-info

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/basic-ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Basic CI
2+
3+
on:
4+
push:
5+
branches: [ mainline ]
6+
pull_request:
7+
branches: [ mainline ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -e ".[dev]"
31+
32+
- name: Lint with flake8 and pylint
33+
run: |
34+
make lint
35+
36+
- name: Test with pytest
37+
run: |
38+
make test
39+
40+
build:
41+
runs-on: ubuntu-latest
42+
needs: test
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: "3.12"
51+
52+
- name: Build package
53+
run: |
54+
python -m pip install --upgrade pip build twine
55+
python -m build
56+
57+
- name: Check package
58+
run: |
59+
python -m twine check dist/*

.github/workflows/codeql.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ mainline ]
6+
pull_request:
7+
branches: [ mainline ]
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
security-events: write
14+
packages: read
15+
actions: read
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: github/codeql-action/init@v3
20+
with:
21+
languages: python
22+
- uses: github/codeql-action/analyze@v3
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Coverage Check
2+
3+
on:
4+
pull_request:
5+
branches: [ "**" ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
coverage-check:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[dev]"
29+
30+
- name: Get base branch coverage
31+
run: |
32+
git checkout origin/mainline
33+
pip install -e ".[dev]"
34+
python -m pytest tests/ -m "not integration" --cov=src --cov-report=json:coverage-base.json --tb=no -q || true
35+
BASE_COVERAGE=$(python -c "import json; print(json.load(open('coverage-base.json'))['totals']['percent_covered'])")
36+
echo "BASE_COVERAGE=$BASE_COVERAGE" >> $GITHUB_ENV
37+
echo "Base branch coverage: $BASE_COVERAGE%"
38+
39+
- name: Get PR coverage
40+
run: |
41+
git checkout ${{ github.event.pull_request.head.sha }}
42+
pip install -e ".[dev]"
43+
python -m pytest tests/ -m "not integration" --cov=src --cov-report=json:coverage-pr.json --tb=no -q || true
44+
PR_COVERAGE=$(python -c "import json; print(json.load(open('coverage-pr.json'))['totals']['percent_covered'])")
45+
echo "PR_COVERAGE=$PR_COVERAGE" >> $GITHUB_ENV
46+
echo "PR branch coverage: $PR_COVERAGE%"
47+
48+
- name: Compare coverage and enforce increase
49+
run: |
50+
python -c "
51+
import sys
52+
base = float('${{ env.BASE_COVERAGE }}')
53+
pr = float('${{ env.PR_COVERAGE }}')
54+
diff = pr - base
55+
56+
print(f'Coverage Report')
57+
print(f'Base coverage: {base:.2f}%')
58+
print(f'PR coverage: {pr:.2f}%')
59+
print(f'Coverage change: {diff:+.2f}%')
60+
print()
61+
62+
if diff < -0.01: # Allow small floating point differences
63+
print('❌ Coverage decreased! This PR reduces test coverage.')
64+
print('Please add tests to maintain or improve coverage.')
65+
sys.exit(1)
66+
elif diff > 0.01:
67+
print('✅ Coverage increased! Great job improving test coverage.')
68+
else:
69+
print('➡️ Coverage unchanged (within tolerance).')
70+
"

.github/workflows/trufflehog.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TruffleHog to Scan for Secrets
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
TruffleHog:
9+
name: TruffleHog
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
shell: bash
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: TruffleHog OSS
21+
id: trufflehog
22+
uses: trufflesecurity/trufflehog@main
23+
continue-on-error: true
24+
with:
25+
path: ./
26+
base: "${{ github.event.repository.default_branch }}"
27+
head: HEAD
28+
extra_args: --only-verified
29+
- name: Scan Results Status
30+
if: steps.trufflehog.outcome == 'failure'
31+
run: exit 1

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.egg-info/
6+
*.egg
7+
.Python
8+
build/
9+
dist/
10+
*.so
11+
12+
# Virtual environments
13+
.venv/
14+
.venv-testing/
15+
pyvenv.cfg
16+
17+
# Testing & Coverage
18+
.coverage
19+
.coverage.*
20+
.pytest_cache/
21+
htmlcov/
22+
coverage.xml
23+
nosetests.xml
24+
25+
# Editor / IDE
26+
*~
27+
*#
28+
*.swp
29+
.DS_Store
30+
.vscode/
31+
.idea/
32+
.kiro/
33+
34+
# Logs
35+
logs/
36+
*.log
37+
38+
# AWS credentials and sensitive files
39+
.env
40+
.aws/
41+
*.pem
42+
*.key
43+
examples/aws/credentials.json
44+
45+
# Project-specific config (generated by setup configure)
46+
run-config.json
47+
demo-config.json
48+
49+
# Test kernel RPMs (large binary files)
50+
setup/test-kernel-rpms/
51+
52+
# Local planning files
53+
FAQ.md
54+
upstream-prep.protocol.md
55+
kernel-ci-cloud-labs.zip
56+
57+
# Analysis output data
58+
analysis/data/
59+
60+
# Distribution archives
61+
share/

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 22.12.0
4+
hooks:
5+
- id: black
6+
language_version: python3
7+
8+
- repo: local
9+
hooks:
10+
- id: pylint
11+
name: pylint
12+
entry: pylint
13+
language: system
14+
types: [python]
15+
args: [--max-line-length=120]
16+
17+
- id: clean-logs
18+
name: clean-logs
19+
entry: bash -c 'find logs -type d -name "run_*" -exec rm -rf {} + 2>/dev/null || true; echo "✓ Cleaned up log directories"'
20+
language: system
21+
pass_filenames: false
22+
always_run: true
23+
24+
- id: clean-integration-test-logs
25+
name: clean-integration-test-logs
26+
entry: bash -c 'find logs tests/integration/logs -type d -name "run_*" -exec rm -rf {} + 2>/dev/null || true; echo "✓ Cleaned up log directories"'
27+
language: system
28+
pass_filenames: false
29+
always_run: true

0 commit comments

Comments
 (0)