Skip to content

Commit 7746823

Browse files
committed
install apparmor
1 parent 0316bcf commit 7746823

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

buildspec/linuxUiTests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ phases:
4646
4747
- chmod +x gradlew
4848

49+
- |
50+
>/etc/apparmor.d/jcef
51+
abi <abi/4.0>,
52+
include <tunables/global>
53+
54+
profile /usr/lib/jvm/java-21-amazon-corretto.x86_64/bin/java flags=(unconfined) {
55+
userns,
56+
57+
include if exists <local/chrome>
58+
}
59+
- apparmor_parser -r /etc/apparmor.d/jcef
4960
- ffmpeg -loglevel quiet -nostdin -f x11grab -video_size ${SCREEN_WIDTH}x${SCREEN_HEIGHT} -i ${DISPLAY} -codec:v libx264 -pix_fmt yuv420p -vf drawtext="fontsize=48:box=1:[email protected]:boxborderw=5:fontcolor=white:x=0:y=h-text_h:text='%{gmtime\:%H\\\\\:%M\\\\\:%S}'" -framerate 12 -g 12 /tmp/screen_recording.mp4 &
5061
- ./gradlew -PideProfileName=$ALTERNATIVE_IDE_PROFILE_NAME :ui-tests-starter:uiTest coverageReport --console plain --info
5162

settings.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ include("sandbox-all")
100100
include("ui-tests-starter")
101101
when (providers.gradleProperty("ideProfileName").get()) {
102102
// FIX_WHEN_MIN_IS_242: `tmp-all` test module no longer needed in 242+
103-
"2023.3", "2024.1" -> {
103+
"2024.1" -> {
104104
include("tmp-all")
105-
106-
// only available 242+
105+
}
106+
"2024.1", "2024.2" -> {
107+
// only available 243+
107108
project(":ui-tests-starter").projectDir = file("noop")
108109
}
109110
}

ui-tests-starter/build.gradle.kts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
5+
import org.jetbrains.intellij.platform.gradle.tasks.aware.RuntimeAware
56
import software.aws.toolkits.gradle.findFolders
67
import software.aws.toolkits.gradle.intellij.IdeVersions
78

89
plugins {
910
id("toolkit-kotlin-conventions")
1011
id("toolkit-intellij-plugin")
1112

12-
id("org.jetbrains.intellij.platform.module")
13+
id("org.jetbrains.intellij.platform")
1314
}
1415

1516
val ideProfile = IdeVersions.ideProfile(project)
@@ -100,3 +101,44 @@ val action = Action<TaskExecutionGraph> {
100101
}
101102
}
102103
gradle.taskGraph.whenReady(action)
104+
//
105+
//abstract class InstallCefAppArmor : DefaultTask(), RuntimeAware {
106+
// @TaskAction
107+
// fun execute() {
108+
// println(runtimeLauncher.get().executablePath)
109+
// }
110+
//}
111+
//tasks.register("installCefAppArmor") {
112+
// description = "Install AppArmor profile for JBCef"
113+
// group = "Security"
114+
// val osName = System.getProperty("os.name").lowercase()
115+
// doFirst {
116+
// if (!osName.contains("linux")) {
117+
// println("Skipping AppArmor installation - not running on Linux")
118+
// return@doFirst
119+
// }
120+
// }
121+
//
122+
// doLast {
123+
// val profile = """
124+
// # This profile is autogenerated to allow running sandboxed JCEF
125+
// abi <abi/4.0>,
126+
// include <tunables/global>
127+
//
128+
// profile %s flags=(unconfined) {
129+
// userns,
130+
//
131+
// include if exists <local/chrome>
132+
// }
133+
// """.trimIndent()
134+
// profile.format("/usr/lib/jvm/java-21-amazon-corretto.x86_64/bin/java")
135+
// val profileAction = JBCefAppArmorUtils.getInstallInstallAppArmorProfileAction()
136+
// if (profileAction != null) {
137+
// profileAction.run()
138+
// println("AppArmor profile installation completed")
139+
// } else {
140+
// println("No AppArmor profile installation action available")
141+
// }
142+
// }
143+
//
144+
//}

0 commit comments

Comments
 (0)