-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for functions in openyurt
Signed-off-by: Jason Chua<[email protected]>
- Loading branch information
Showing
16 changed files
with
624 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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,119 @@ | ||
name: Build and Test OpenYurt Deployer | ||
|
||
on: | ||
push: | ||
branches: [ main, legacy-firecracker-v0.24.0-with-upf-support ] | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
pull_request: | ||
branches: [ main, legacy-firecracker-v0.24.0-with-upf-support, openyurt ] | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
env: | ||
GOOS: linux | ||
GO111MODULE: on | ||
|
||
jobs: | ||
main-unit-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.19' | ||
|
||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build scripts | ||
run: | ||
pushd scripts/openyurt-deployer && go build -o oy_deploy && popd | ||
|
||
- name: Allow root login | ||
run: | | ||
echo "PermitRootLogin=yes" | sudo tee -a /etc/ssh/sshd_config | ||
- name: Set up SSH and Run Test | ||
run: | | ||
echo $USER | ||
sudo apt-get update | ||
sudo apt-get install -y openssh-server | ||
sudo service ssh start | ||
eval "$(ssh-agent -s)" | ||
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" | ||
cat > ~/.ssh/config <<EOF | ||
Host host.example | ||
User $USER | ||
HostName 127.0.0.1 | ||
IdentityFile ~/.ssh/id_rsa | ||
EOF | ||
echo -n '' | cat - ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys | ||
sudo service ssh restart | ||
service ssh status | ||
ssh-add ~/.ssh/id_rsa | ||
|
||
cat ~/.ssh/authorized_keys | ||
chmod og-rw ~/.ssh | ||
|
||
cd scripts/openyurt-deployer | ||
go test | ||
|
||
node-unit-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.19' | ||
|
||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build scripts | ||
run: | ||
pushd scripts/openyurt-deployer && go build -o oy_deploy && popd | ||
|
||
- name: Allow root login | ||
run: | | ||
echo "PermitRootLogin=yes" | sudo tee -a /etc/ssh/sshd_config | ||
- name: Set up SSH and Run Test | ||
run: | | ||
echo $USER | ||
sudo apt-get update | ||
sudo apt-get install -y openssh-server | ||
sudo service ssh start | ||
eval "$(ssh-agent -s)" | ||
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" | ||
cat > ~/.ssh/config <<EOF | ||
Host host.example | ||
User $USER | ||
HostName 127.0.0.1 | ||
IdentityFile ~/.ssh/id_rsa | ||
EOF | ||
echo -n '' | cat - ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys | ||
sudo service ssh restart | ||
service ssh status | ||
ssh-add ~/.ssh/id_rsa | ||
|
||
cat ~/.ssh/authorized_keys | ||
chmod og-rw ~/.ssh | ||
|
||
cd scripts/openyurt-deployer/node | ||
go test |
This file contains 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module github.com/vhive-serverless/vHive/scripts | ||
|
||
go 1.19 | ||
|
||
require github.com/vhive-serverless/vHive/scripts/utils v0.0.0-20231114022852-400a49d284cb | ||
|
||
require github.com/vhive-serverless/vHive/scripts/configs v0.0.0-20231114022852-400a49d284cb // indirect |
This file contains 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,4 @@ | ||
github.com/vhive-serverless/vHive/scripts/configs v0.0.0-20231114022852-400a49d284cb h1:JoudbjIOvkLiDY7WjaQosP0IKipHnlxFOCIeICQrtRQ= | ||
github.com/vhive-serverless/vHive/scripts/configs v0.0.0-20231114022852-400a49d284cb/go.mod h1:nJSon4Eng7PdZ4HJX9dnZ7H4qxVm/r5zseFPfom7Jto= | ||
github.com/vhive-serverless/vHive/scripts/utils v0.0.0-20231114022852-400a49d284cb h1:SmFLKJc4wAhr61ige8hoLiLWDKAI2uewBQUNejI63Hs= | ||
github.com/vhive-serverless/vHive/scripts/utils v0.0.0-20231114022852-400a49d284cb/go.mod h1:xyjKlPn6JqSQtzKOCu8L4DW4rQcNmhxK9f97cOPo0Sg= |
This file contains 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 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 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 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
go 1.19 | ||
go 1.20 | ||
|
||
use( | ||
. | ||
./configs | ||
./node | ||
./template | ||
) | ||
use ( | ||
. | ||
./configs | ||
./node | ||
./template | ||
) |
This file contains 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.