mirror of
https://github.com/dredx/prole.git
synced 2026-09-27 11:34:30 +00:00
- Introduce lib/shell helpers and keep etc/* scripts thin via compatibility shims - Move Kerberos validation to scripts/validation/check_kerberos.sh and update callers - Add deterministic shellspec unit tests under tests/shellspec/ and wire Maven to run them - Add minimal Spring Boot authority module with startup + /health endpoint and Maven wiring - Document the new layout in docs/layout.md Co-authored-by: Junie <junie@jetbrains.com>
37 lines
1011 B
Bash
37 lines
1011 B
Bash
#shellcheck shell=sh
|
|
|
|
Describe 'intercept example'
|
|
Intercept begin
|
|
__begin__() {
|
|
# Define stubs for cat
|
|
cat() {
|
|
if [ "${1:-}" = "/proc/cpuinfo" ];then
|
|
%text
|
|
#|processor : 0
|
|
#|vendor_id : GenuineIntel
|
|
#|cpu family : 6
|
|
#|model : 58
|
|
#|model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
|
|
#|
|
|
#|processor : 1
|
|
#|vendor_id : GenuineIntel
|
|
#|cpu family : 6
|
|
#|model : 58
|
|
#|model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
|
|
#|
|
|
#|processor : 2
|
|
#|vendor_id : GenuineIntel
|
|
#|cpu family : 6
|
|
#|model : 58
|
|
#|model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
|
|
else
|
|
command cat "$@"
|
|
fi
|
|
}
|
|
}
|
|
Example 'test cpunum.sh with stubbed cat /cpu/info'
|
|
When run source ./count_cpus.sh
|
|
The stdout should eq 3
|
|
End
|
|
End
|