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 3737
3838 # Run the test cases
3939 - name : Run the test cases
40- run : docker run --volume $(pwd)/tests:/tests tools_cloudshell /bin/bash /tests/test.sh
40+ run : docker run -it - -volume $(pwd)/tests:/tests tools_cloudshell /bin/bash /tests/test.sh
4141
4242 # Show Docker image size
4343 - 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
6666RUN ln -s /usr/bin/python3 /usr/bin/python
6767RUN ln -s /usr/bin/node /usr/bin/nodejs
6868
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
7373
7474# Set AZUREPS_HOST_ENVIRONMENT
7575ENV 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" {
7474
7575 It " has local paths in `$ PATH" {
7676 $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"
7979 }
8080
8181 It " Ansible pwsh has modules" {
Original file line number Diff line number Diff line change @@ -19,5 +19,9 @@ pwsh /tests/root-tests.ps1
1919
2020pwsh -c " Install-Module Pester -Force -Scope AllUsers"
2121
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.
2226echo " 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