|
35 | 35 |
|
36 | 36 | @pytest.fixture |
37 | 37 | def model_obj(): |
38 | | - return KernelDataModel(kernel_version="5.13.0-30-generic") |
| 38 | + return KernelDataModel( |
| 39 | + kernel_version="Linux MockSystem 5.13.0-30-generic #1 XYZ Day Month 10 15:19:13 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux", |
| 40 | + kernel_info="5.13.0-30-generic", |
| 41 | + ) |
39 | 42 |
|
40 | 43 |
|
41 | 44 | @pytest.fixture |
42 | 45 | def config(): |
43 | 46 | return { |
44 | 47 | "kernel_name": [ |
45 | | - "5.13.0-30-generic", |
46 | | - "5.15.0-31-generic", |
47 | | - "5.18.0-32-generic", |
| 48 | + "Linux MockSystem 5.13.0-30-generic #1 XYZ Day Month 10 15:19:13 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux", |
| 49 | + "Linux MockSystem1 5.15.0-31-generic #39 XYZA Day MonthX 10 24:19:13 IST 2024 x86_64 GNU/Linux", |
| 50 | + "Linux MockSystem2 5.18.0-32-generic #178 XYZaB Day MonthY 10 15:06:11 PDT 2024 Linux", |
48 | 51 | ], |
49 | 52 | "invalid": "invalid", |
50 | 53 | } |
@@ -118,14 +121,14 @@ def test_invalid_kernel_config(system_info, model_obj, config): |
118 | 121 |
|
119 | 122 |
|
120 | 123 | def test_match_regex(system_info, model_obj): |
121 | | - args = KernelAnalyzerArgs(exp_kernel=[r"5.13.\d-\d+-[\w]+"], regex_match=True) |
| 124 | + args = KernelAnalyzerArgs(exp_kernel=[r".*5\.13\.\d+-\d+-[\w-]+.*"], regex_match=True) |
122 | 125 | analyzer = KernelAnalyzer(system_info) |
123 | 126 | result = analyzer.analyze_data(model_obj, args) |
124 | 127 | assert result.status == ExecutionStatus.OK |
125 | 128 |
|
126 | 129 |
|
127 | 130 | def test_mismatch_regex(system_info, model_obj): |
128 | | - args = KernelAnalyzerArgs(exp_kernel=[r"4.3.\d-\d+-[\w]+"], regex_match=True) |
| 131 | + args = KernelAnalyzerArgs(exp_kernel=[r".*4\.13\.\d+-\d+-[\w-]+.*"], regex_match=True) |
129 | 132 | analyzer = KernelAnalyzer(system_info) |
130 | 133 | result = analyzer.analyze_data(model_obj, args) |
131 | 134 |
|
|
0 commit comments