File tree Expand file tree Collapse file tree 5 files changed +23
-8
lines changed Expand file tree Collapse file tree 5 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 37
37
38
38
# Run the test cases
39
39
- name : Run the test cases
40
- run : docker run --volume $(pwd)/tests:/tests tools_cloudshell /bin/bash /tests/test.sh
40
+ run : docker run -i - -volume $(pwd)/tests:/tests tools_cloudshell /bin/bash /tests/test.sh
41
41
42
42
# Show Docker image size
43
43
- name : find the pull request id
Original file line number Diff line number Diff line change
1
+ # Start: Define custom environment variables
2
+
3
+ # Add dotnet tools to PATH so users can install a tool using dotnet tools and
4
+ # can execute that command from any directory
5
+ export PATH=$HOME /.dotnet/tools:$PATH
6
+
7
+ # Add user's home directories to PATH at the front so they can install tools
8
+ # which override defaults
9
+ export PATH=$HOME /.local/bin:$HOME /bin:$PATH
10
+
11
+ # End: Define custom environment variables
Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ RUN rm -f ./linux/Dockerfile && rm -f /bin/su
66
66
RUN ln -s /usr/bin/python3 /usr/bin/python
67
67
RUN ln -s /usr/bin/node /usr/bin/nodejs
68
68
69
- # Add user's home directories to PATH at the front so they can install tools which
70
- # override defaults
71
- # Add dotnet tools to PATH so users can install a tool using dotnet tools and can execute that command from any directory
72
- ENV PATH ~/.local/bin:~/bin:~/.dotnet/tools:$PATH
69
+ # Add custom environment variables to /etc/skel/.bashrc so they will be
70
+ # available to users any time they open a new shell.
71
+ COPY ./linux/bash/bashrc linux/bashrc
72
+ RUN cat linux/bashrc >> /etc/skel/.bashrc && rm linux/bashrc
73
73
74
74
# Set AZUREPS_HOST_ENVIRONMENT
75
75
ENV AZUREPS_HOST_ENVIRONMENT cloud-shell/1.0
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ Describe "Various programs installed with expected versions" {
74
74
75
75
It " has local paths in `$ PATH" {
76
76
$paths = ($env: PATH ).split(" :" )
77
- $paths | Should - Contain " ~ /bin"
78
- $paths | Should - Contain " ~ /.local/bin"
77
+ $paths | Should - Contain " $HOME /bin"
78
+ $paths | Should - Contain " $HOME /.local/bin"
79
79
}
80
80
81
81
It " Ansible pwsh has modules" {
Original file line number Diff line number Diff line change @@ -19,5 +19,9 @@ pwsh /tests/root-tests.ps1
19
19
20
20
pwsh -c " Install-Module Pester -Force -Scope AllUsers"
21
21
22
+ # Run tests as csuser with an interactive shell to verify the configuration in
23
+ # the same environment this imange will be used in. Otherwise, the .bashrc won't
24
+ # be sourced and the bash configuration (e.g., environment variables) won't be
25
+ # set during the tests.
22
26
echo " running tests as csuser"
23
- runuser -u csuser pwsh /tests/test.ps1
27
+ runuser -u csuser -- /bin/bash -i -c ' pwsh /tests/test.ps1'
You can’t perform that action at this time.
0 commit comments