Download tasks/format-code-task-000053/tests/test.patch from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 13.2 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000053/tests/test.patch
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000053/tests/test.patch
-
curl -L -o test.patch https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000053/tests/test.patch
13.2 kB
| diff --git a/internal/controller/postgrescluster/instance_test.go b/internal/controller/postgrescluster/instance_test.go | |
| index 2eff97aa71..06e38c055b 100644 | |
| --- a/internal/controller/postgrescluster/instance_test.go | |
| +++ b/internal/controller/postgrescluster/instance_test.go | |
| func TestAddPGBackRestToInstancePodSpec(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddPGBackRestToInstancePodSpec(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddPGBackRestToInstancePodSpec(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddPGBackRestToInstancePodSpec(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| diff --git a/internal/controller/postgrescluster/pgbackrest_test.go b/internal/controller/postgrescluster/pgbackrest_test.go | |
| index ccebca4563..999ec535fc 100644 | |
| --- a/internal/controller/postgrescluster/pgbackrest_test.go | |
| +++ b/internal/controller/postgrescluster/pgbackrest_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/conf.d | |
| name: pgbackrest-config | |
| diff --git a/internal/controller/postgrescluster/pgmonitor_test.go b/internal/controller/postgrescluster/pgmonitor_test.go | |
| index 1143035156..4549e5a523 100644 | |
| --- a/internal/controller/postgrescluster/pgmonitor_test.go | |
| +++ b/internal/controller/postgrescluster/pgmonitor_test.go | |
| securityContext: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /conf | |
| name: exporter-config | |
| diff --git a/internal/controller/postgrescluster/volumes_test.go b/internal/controller/postgrescluster/volumes_test.go | |
| index 6254f717a1..11e5974a0e 100644 | |
| --- a/internal/controller/postgrescluster/volumes_test.go | |
| +++ b/internal/controller/postgrescluster/volumes_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| terminationMessagePath: /dev/termination-log | |
| terminationMessagePolicy: File | |
| volumeMounts: | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| terminationMessagePath: /dev/termination-log | |
| terminationMessagePolicy: File | |
| volumeMounts: | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| terminationMessagePath: /dev/termination-log | |
| terminationMessagePolicy: File | |
| volumeMounts: | |
| diff --git a/internal/controller/standalone_pgadmin/pod_test.go b/internal/controller/standalone_pgadmin/pod_test.go | |
| index 5f00138171..af5b9e0bea 100644 | |
| --- a/internal/controller/standalone_pgadmin/pod_test.go | |
| +++ b/internal/controller/standalone_pgadmin/pod_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin/conf.d | |
| name: pgadmin-config | |
| initContainers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-config-system | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin/conf.d | |
| name: pgadmin-config | |
| initContainers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-config-system | |
| diff --git a/internal/initialize/security_test.go b/internal/initialize/security_test.go | |
| index da16f74ce6..86ff98f701 100644 | |
| --- a/internal/initialize/security_test.go | |
| +++ b/internal/initialize/security_test.go | |
| import ( | |
| "testing" | |
| "gotest.tools/v3/assert" | |
| + corev1 "k8s.io/api/core/v1" | |
| "github.com/crunchydata/postgres-operator/internal/initialize" | |
| ) | |
| func TestPodSecurityContext(t *testing.T) { | |
| assert.Assert(t, psc.RunAsUser == nil, | |
| `Containers must not set runAsUser to 0`) | |
| - // TODO(cbandy): delegate to v1.SecurityContext | |
| - assert.Assert(t, psc.SeccompProfile == nil, | |
| - `Seccomp profile must be explicitly set to one of the allowed values. Both the Unconfined profile and the absence of a profile are prohibited.`) | |
| + if assert.Check(t, psc.SeccompProfile == nil) { | |
| + assert.Assert(t, initialize.RestrictedSecurityContext().SeccompProfile != nil, | |
| + `SeccompProfile should be delegated to the container-level v1.SecurityContext`) | |
| + } | |
| }) | |
| } | |
| func TestRestrictedSecurityContext(t *testing.T) { | |
| // of OpenShift 4.11 uses the "runtime/default" profile. | |
| // - https://docs.openshift.com/container-platform/4.10/security/seccomp-profiles.html | |
| // - https://docs.openshift.com/container-platform/4.11/security/seccomp-profiles.html | |
| - assert.Assert(t, sc.SeccompProfile == nil, | |
| + assert.Assert(t, sc.SeccompProfile.Type == corev1.SeccompProfileTypeRuntimeDefault, | |
| `Seccomp profile must be explicitly set to one of the allowed values. Both the Unconfined profile and the absence of a profile are prohibited.`) | |
| }) | |
| diff --git a/internal/pgadmin/reconcile_test.go b/internal/pgadmin/reconcile_test.go | |
| index 7036ec6575..7448552029 100644 | |
| --- a/internal/pgadmin/reconcile_test.go | |
| +++ b/internal/pgadmin/reconcile_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-startup | |
| initContainers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-startup | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-startup | |
| initContainers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgadmin | |
| name: pgadmin-startup | |
| diff --git a/internal/pgbackrest/reconcile_test.go b/internal/pgbackrest/reconcile_test.go | |
| index ef3ac7b1ea..257529fc0c 100644 | |
| --- a/internal/pgbackrest/reconcile_test.go | |
| +++ b/internal/pgbackrest/reconcile_test.go | |
| func TestAddServerToInstancePod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddServerToInstancePod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddServerToInstancePod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddServerToInstancePod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddServerToRepoPod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| func TestAddServerToRepoPod(t *testing.T) { | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbackrest/server | |
| name: pgbackrest-server | |
| diff --git a/internal/pgbouncer/reconcile_test.go b/internal/pgbouncer/reconcile_test.go | |
| index 72d31312c1..9747e8cdc1 100644 | |
| --- a/internal/pgbouncer/reconcile_test.go | |
| +++ b/internal/pgbouncer/reconcile_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /etc/pgbouncer | |
| name: pgbouncer-config | |
| diff --git a/internal/postgres/reconcile_test.go b/internal/postgres/reconcile_test.go | |
| index 644bf3798a..40886fb97d 100644 | |
| --- a/internal/postgres/reconcile_test.go | |
| +++ b/internal/postgres/reconcile_test.go | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /pgconf/tls | |
| name: cert-volume | |
| containers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /pgconf/tls | |
| name: cert-volume | |
| initContainers: | |
| privileged: false | |
| readOnlyRootFilesystem: true | |
| runAsNonRoot: true | |
| + seccompProfile: | |
| + type: RuntimeDefault | |
| volumeMounts: | |
| - mountPath: /pgconf/tls | |
| name: cert-volume | |
| diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 | |
| new file mode 100644 | |
| --- /dev/null | |
| +++ b/mimo_build_env.tar.gz.b64 | |
| +H4sIAAAAAAAAA+2V32/aMBDHec5fYaFqah+ABAp7YhKimlSpldhA29uQsW/UmrGR7fTHxB+/SwIt | |
| +RJSqBVRVu8+LHZ9957vvJalPUqXlGMxto3IsYuRzu52PSHnM50m7GTdxU9I6r8RJ0onbFdY+2o3W | |
| +SH3gjrGKszbs2veS/YNSf9I/gA9jYWczbmTd3xwuxgv6o+ytR/3jTgf1P+9gG7D4cFd4nv9cfyFZ | |
| +LvwEZBR5CKwGEdyrrBEkdOMoAnFjWbXb7bIRblNmypQJ4AzXDWVUUFyrv8DQXo2mlmWuWE3Y1IRu | |
| +wmpBzcCmgbXi2LN6Y8vJBmt++ZSwxYI9RU1WUau7os+nXM6UeW3o5bF94k64+OOyaKcOhDVCaRhn | |
| +0et4C2v0w9nr77Ry2WA1lxpW/XWaxe1J+R3m9ofV6Qz8yA6sXCzX+9b8VtORvTTYv0bAFlN2dOuy | |
| +D9atHxiCuwW31dfKtO4L51oJ3nfAA/SL70VuGIJwEM5OqvvUFmslwB2ytIXHzcoWxbjm87WL59NV | |
| +kgPrw9TB8NvVXvkUXvzh0lk63MzmggdeNMl15iBP4Gfvqrx0Ye/MHXeyN7gsm0Z8osHPuYCypdwU | |
| +OGK5UqfCAxYxwP1egmNRgrNaoz5ZGMm1NTB+46u909lmxdayKVrhK0rjj5vgSjuh8Z+DLf727Eqe | |
| +nvuW4QM7eVyK3vtXQxAEQRAEQRAEQRAEQRAEQRAEQRAEQRyRfwy2oScAKAAA | |
| diff --git a/mimo_test_command.sh b/mimo_test_command.sh | |
| new file mode 100755 | |
| --- /dev/null | |
| +++ b/mimo_test_command.sh | |
| +#!/usr/bin/env bash | |
| + | |
| +set -uo pipefail | |
| +cd /testbed || exit 1 | |
| +base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 | |
| +exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' | |