File tree Expand file tree Collapse file tree 4 files changed +63
-56
lines changed Expand file tree Collapse file tree 4 files changed +63
-56
lines changed Original file line number Diff line number Diff line change 5
5
name : FreeBSD
6
6
freebsd_instance :
7
7
image : freebsd-13-0-release-amd64
8
- setup_script :
9
- - pkg install -y git gmake bash
10
- - echo "========="
11
- - echo "Acquire tags for the repo"
12
- - git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
13
- - echo "========="
14
- - echo "Display the current git status"
15
- - git status
16
- - git describe
17
- - echo "========="
18
- - echo "Prep cargo dirs"
19
- - mkdir -p ~/.cargo/{registry,git}
20
- - echo "========="
21
- - echo "Install Rustup using ./rustup-init.sh"
22
- - sh rustup-init.sh --default-toolchain=stable --profile=minimal -y
23
- # It's the equivalent of `source`
24
- - . $HOME/.cargo/env
25
- - echo "========="
26
- - echo "Ensure we have the components we need"
27
- - rustup component add rustfmt
28
- - rustup component add clippy
29
- - echo "========="
30
- - echo "Run the freebsd check"
31
- - unset SKIP_TESTS
32
- - export LIBZ_SYS_STATIC=1
33
- - export CARGO_BUILD_JOBS=1
34
- - export TARGET="x86_64-unknown-freebsd"
35
- - bash ci/run.bash
8
+ setup_script : |
9
+ pkg install -y git gmake bash
10
+ echo "========="
11
+ echo "create non-root user and log into it"
12
+ pw group add -n tester
13
+ pw user add -n tester -g tester -s `which bash`
14
+ pw user mod tester -d `pwd`
15
+ chown -R tester .
16
+ sudo -u tester bash ci/cirrus-templates/script.bash
36
17
upload_to_s3 :
37
18
only_if : $CIRRUS_BRANCH == "stable"
38
19
script :
Original file line number Diff line number Diff line change 5
5
name : FreeBSD
6
6
freebsd_instance :
7
7
image : freebsd-13-0-release-amd64
8
- setup_script :
9
- - pkg install -y git gmake bash
10
- - echo "========="
11
- - echo "Acquire tags for the repo"
12
- - git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
13
- - echo "========="
14
- - echo "Display the current git status"
15
- - git status
16
- - git describe
17
- - echo "========="
18
- - echo "Prep cargo dirs"
19
- - mkdir -p ~/.cargo/{registry,git}
20
- - echo "========="
21
- - echo "Install Rustup using ./rustup-init.sh"
22
- - sh rustup-init.sh --default-toolchain=stable --profile=minimal -y
23
- # It's the equivalent of `source`
24
- - . $HOME/.cargo/env
25
- - echo "========="
26
- - echo "Ensure we have the components we need"
27
- - rustup component add rustfmt
28
- - rustup component add clippy
29
- - echo "========="
30
- - echo "Run the freebsd check"
31
- - unset SKIP_TESTS
32
- - export LIBZ_SYS_STATIC=1
33
- - export CARGO_BUILD_JOBS=1
34
- - export TARGET="x86_64-unknown-freebsd"
35
- - bash ci/run.bash
8
+ setup_script : |
9
+ pkg install -y git gmake bash
10
+ echo "========="
11
+ echo "create non-root user and log into it"
12
+ pw group add -n tester
13
+ pw user add -n tester -g tester -s `which bash`
14
+ pw user mod tester -d `pwd`
15
+ chown -R tester .
16
+ sudo -u tester bash ci/cirrus-templates/script.bash
36
17
upload_to_s3 :
37
18
only_if : $CIRRUS_BRANCH == "stable"
38
19
script :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -ex
4
+
5
+ # First, we check that this script is not run as root because it would fail tests.
6
+ if [ " root" == " $( whoami) " ]; then exit 1; fi
7
+
8
+ echo " ========="
9
+ echo " Acquire tags for the repo"
10
+
11
+ git fetch --no-tags --prune --depth=1 origin +refs/tags/* :refs/tags/*
12
+
13
+ echo " ========="
14
+ echo " Display the current git status"
15
+
16
+ git status
17
+ git describe
18
+
19
+ echo " ========="
20
+ echo " Prep cargo dirs"
21
+
22
+ mkdir -p ~ /.cargo/{registry,git}
23
+
24
+ echo " ========="
25
+ echo " Install Rustup using ./rustup-init.sh"
26
+
27
+ sh rustup-init.sh --default-toolchain=stable --profile=minimal -y
28
+ # It's the equivalent of `source`
29
+ source " $HOME " /.cargo/env
30
+
31
+ echo " ========="
32
+ echo " Ensure we have the components we need"
33
+
34
+ rustup component add rustfmt
35
+ rustup component add clippy
36
+
37
+ echo " ========="
38
+ echo " Run the freebsd check"
39
+
40
+ unset SKIP_TESTS
41
+ export LIBZ_SYS_STATIC=1
42
+ export CARGO_BUILD_JOBS=1
43
+ export TARGET=" x86_64-unknown-freebsd"
44
+ bash ci/run.bash
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ export PATH="$HOME/apple/bin"
109
109
} ) ;
110
110
}
111
111
112
+ // This test should NOT be run as root!
112
113
#[ test]
113
114
fn install_errors_when_rc_cannot_be_updated ( ) {
114
115
clitools:: setup ( Scenario :: Empty , & |config| {
You can’t perform that action at this time.
0 commit comments