-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch from travis to github actions
- Loading branch information
Showing
5 changed files
with
576 additions
and
106 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,104 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
TARGET: 'iqn.2016-09.com.gotgt.gostor:example_tgt_0' | ||
TGT_CFG: '{"storages":[{"deviceID":1000,"path":"file:/var/tmp/disk.img","online":true}],"iscsiportals":[{"id":0,"portal":"127.0.0.1:3260"}],"iscsitargets":{"iqn.2016-09.com.gotgt.gostor:example_tgt_0":{"tpgts":{"1":[0]},"luns":{"0":1000}}}}' | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Depend install | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libcunit1 libcunit1-doc libcunit1-dev open-iscsi make -y | ||
- name: Gofmt verify | ||
run: hack/verify-gofmt.sh | ||
|
||
- name: Build | ||
run: make | ||
|
||
- name: Unit Test | ||
run: go test -v ./pkg/... ./mock/... | ||
|
||
- name: Function test | ||
run: | | ||
dd if=/dev/zero of=/var/tmp/disk.img bs=1024 count=102400 | ||
mkdir ${HOME}/.gotgt | ||
echo ${TGT_CFG} > ${HOME}/.gotgt/config.json | ||
./_output/cmd/bin/gotgt daemon --log debug 1>/dev/null 2>&1 & | ||
git clone https://github.com/gostor/libiscsi ${HOME}/libiscsi | ||
cd ${HOME}/libiscsi | ||
sudo ci/install.sh | ||
export ISCSITEST=yes | ||
./autogen.sh | ||
./configure 2>&1 >/dev/null | ||
make 2>&1 >/dev/null | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.Standard iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.AllocLength iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.MandatoryVPDSBC iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.SupportedVPD iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.VersionDescriptors iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Inquiry.EVPD iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Mandatory iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.ModeSense6 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.NoMedia iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Prefetch10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Prefetch16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.PreventAllow iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.ReadCapacity10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.ReadCapacity16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Read6 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Read10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Read12 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Read16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.ReadOnly iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.ReportSupportedOpcodes.Simple iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Reserve6.Simple iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.StartStopUnit iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.TestUnitReady iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Write10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Write16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Write12 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.WriteVerify10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.WriteVerify16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.WriteVerify12 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.WriteSame10.Simple iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.WriteSame16.Simple iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Verify10 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Verify12 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.Verify16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.iSCSITMF iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./test-tool/iscsi-test-cu -d -A --test=ALL.iSCSIcmdsn iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./utils/iscsi-ls -s iscsi://127.0.0.1:3260/${TARGET} | ||
./utils/iscsi-inq iscsi://127.0.0.1:3260/${TARGET}/0 | ||
./utils/iscsi-readcapacity16 iscsi://127.0.0.1:3260/${TARGET}/0 | ||
# iscsi initiator test | ||
sudo iscsiadm -m discovery -t sendtargets -p 127.0.0.1 | ||
sudo iscsiadm -m node -L all | ||
sudo iscsiadm -m session | ||
sudo fdisk -l | ||
echo -e "n\np\n1\n\n\nt\nc\na\nw" | sudo fdisk /dev/sdc | ||
sudo mkfs.ext3 /dev/sdc1 | ||
sudo mkdir -p /var/tmp/test | ||
sudo mount /dev/sdc1 /var/tmp/test | ||
sudo ls -lh /var/tmp/test/ |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.