-
Notifications
You must be signed in to change notification settings - Fork 12
Feature/new tests #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4c96a8c
improve error messaging
rlogwood 219272f
add prune and policy test, add zelta policy config file generator, su…
rlogwood 7a2e0fd
add prune and policy test, remove warnings from clone and revert for …
rlogwood f0f7470
regenerate tests, add new prune and policy test
rlogwood 9a7d1bd
add more context on sudoers update to include Ubuntu and FreeBSD
rlogwood 6f1cb36
add zman alias
rlogwood d8278d1
fix wildcarding, move all subs to ruby and out of awk, refactor test …
rlogwood b1b7773
streamline test gen, regenerate all tests
rlogwood 5023942
improve error handling, prevent shell exit from source files
rlogwood 09dfd5f
regenerate all tests with matcher function printf fix
rlogwood d8bdd18
use printf instead of echo in normalization
rlogwood f6d62bc
handle localhost when generating policy
rlogwood 528a5a0
add vm helpers for mimicign github testing, first version of github w…
rlogwood 3daffb3
run shellspec install with sudo
rlogwood a3430b5
add ShellSpec Tests status badge before what's new
rlogwood 4198bc5
reposition the ShellSpec Tests badge
rlogwood b93b7bd
regenerated test with matcher func fix
rlogwood 411e6b4
fix line evaluation in matcher function
rlogwood d9c2566
update bellhye to bell-tower in urls
rlogwood 2793eff
fix typo fo -> of
rlogwood f9a66da
better defaults for local runs, leave remotes commented out by default
rlogwood ef29644
clean up comments
rlogwood 2c4f337
do not add empty env vars to the map
rlogwood 521da0f
remove debug info
rlogwood ceeabc7
run under bash shell
rlogwood 3868d43
fix !# path for env
rlogwood 50b234c
make testuser sudoer file 0440
rlogwood 17a87c6
Replace real user/host identifiers with fake placeholders in zelta_te…
Copilot 75e2cec
fix argument evaluation to allow optional arg passing
rlogwood 9f5d244
update ownership and perm explicitly on testuser sudoers and verify.
rlogwood a378ae2
git ignore shellspec generated policy file, rename current file to .e…
rlogwood 4c59980
chown, chmod, verify sudoers file
rlogwood 82e4753
improve setup and test instructions
rlogwood 89bc168
ensure no dependency on ~ evaluation
rlogwood 5a09776
avoid awk implementation specific treatment of \$ escapes
rlogwood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: ShellSpec Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, dev, "feature/**"] | ||
| pull_request: | ||
| branches: [main, dev] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y zfsutils-linux man-db | ||
|
|
||
| - name: Install ShellSpec | ||
| run: curl -fsSL https://git.io/shellspec | sudo sh -s -- --yes --prefix /usr/local | ||
|
|
||
| - name: Create test user | ||
| run: | | ||
| sudo useradd -m -s /bin/bash testuser | ||
| echo 'testuser ALL=(ALL) NOPASSWD: /usr/bin/dd *, /usr/bin/rm -f /tmp/*, /usr/bin/truncate *, /usr/sbin/zpool *, /usr/sbin/zfs *' \ | ||
| | sudo tee /etc/sudoers.d/testuser | ||
rlogwood marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sudo chown root:root /etc/sudoers.d/testuser | ||
| sudo chmod 0440 /etc/sudoers.d/testuser | ||
| sudo visudo -cf /etc/sudoers.d/testuser | ||
|
|
||
| - name: Copy repo for test user | ||
| run: | | ||
| sudo cp -r "$GITHUB_WORKSPACE" /home/testuser/zelta | ||
| sudo chown -R testuser:testuser /home/testuser/zelta | ||
|
|
||
| - name: Run ShellSpec tests | ||
| run: | | ||
| sudo -u testuser env \ | ||
| SANDBOX_ZELTA_SRC_POOL=apool \ | ||
| SANDBOX_ZELTA_TGT_POOL=bpool \ | ||
| SANDBOX_ZELTA_SRC_DS=apool/treetop \ | ||
| SANDBOX_ZELTA_TGT_DS=bpool/backups \ | ||
| bash -c 'cd /home/testuser/zelta && shellspec' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.