Skip to content

Commit

Permalink
Merge pull request #3040 from M0ses/osc-based-testing
Browse files Browse the repository at this point in the history
first version of osc based testing
  • Loading branch information
M0ses committed Apr 26, 2017
2 parents a99defe + eb9dd27 commit aebc444
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 0 deletions.
17 changes: 17 additions & 0 deletions dist/t/osc/0000_configure_osc.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e
echo "1..1"

cat <<EOF > $HOME/.oscrc
[general]
apiurl = https://localhost
[https://localhost]
user=Admin
pass=opensuse
EOF

echo "ok - configuring osc"

exit 0
19 changes: 19 additions & 0 deletions dist/t/osc/0010_create_interconnect.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

BASE_DIR=$(dirname $0)

#export BASH_TAP_ROOT=$BASE_DIR
#. $BASE_DIR/../bash-tap-bootstrap

# plan
echo "1..1"

osc meta prj openSUSE.org -F $BASE_DIR/fixtures/openSUSE.org.xml

if [ $? -gt 0 ];then
echo "not ok - Creation of interconnect project"
else
echo "ok - Creation of interconnect project"
fi

exit 0
17 changes: 17 additions & 0 deletions dist/t/osc/0020_create_home:Admin.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# plan
echo "1..1"

BASE_DIR=$(dirname $0)
TMP_DIR=$BASE_DIR/tmp

osc meta prj home:Admin -F $BASE_DIR/fixtures/home\:Admin.xml

if [ $? -gt 0 ];then
echo "not ok - Creation of home:Admin project"
else
echo "ok - Creation of home:Admin project"
fi

exit 0
38 changes: 38 additions & 0 deletions dist/t/osc/0030_create_and_build_package.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

RCODE=0
# plan
echo "1..1"

BASE_DIR=$(dirname $0)

#export BASH_TAP_ROOT=$BASE_DIR
#. $BASE_DIR/../bash-tap-bootstrap

TMP_DIR=$BASE_DIR/tmp

rm -rf $TMP_DIR
mkdir -p $TMP_DIR
cd $TMP_DIR

osc co home:Admin
cd home\:Admin
mkdir obs-testpackage
osc add obs-testpackage
cd obs-testpackage
cp $BASE_DIR/fixtures/obs-testpackage._service ./_service
osc ar
osc ci -m "initial version"
osc r -w


got=`osc r|grep succeeded|wc -l`

if [ $got -eq 2 ];then
echo "ok - Checking build results"
else
echo "not ok - Checking build results"
RCODE=1
fi

exit $RCODE
17 changes: 17 additions & 0 deletions dist/t/osc/0040_delete_package_build.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# plan
echo "1..1"

BASE_DIR=$(dirname $0)
TMP_DIR=$BASE_DIR/tmp
cd $TMP_DIR/home\:Admin
osc delete obs-testpackage

if [ $? -gt 0 ];then
echo "not ok - Deleting package obs-testpackage"
else
echo "ok - Deleting package obs-testpackage"
fi

osc ci -m "removed package obs-testpackage"
13 changes: 13 additions & 0 deletions dist/t/osc/fixtures/home:Admin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<project name="home:Admin">
<title/>
<description/>
<person userid="Admin" role="maintainer"/>
<repository name="openSUSE_Tumbleweed">
<path project="openSUSE.org:openSUSE:Factory" repository="snapshot"/>
<arch>i586</arch>
</repository>
<repository name="openSUSE_Leap_42.2">
<path project="openSUSE.org:openSUSE:Leap:42.2" repository="standard"/>
<arch>x86_64</arch>
</repository>
</project>
14 changes: 14 additions & 0 deletions dist/t/osc/fixtures/obs-testpackage._service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<services>
<service name="obs_scm">
<param name="versionformat">%ad</param>
<param name="url">git://github.com/M0ses/obs-testpackage.git</param>
<param name="scm">git</param>
<param name="extract">dist/obs-testpackage.spec</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="compression">xz</param>
<param name="file">*.tar</param>
</service>
<service name="set_version" mode="buildtime"/>
</services>
5 changes: 5 additions & 0 deletions dist/t/osc/fixtures/openSUSE.org.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<project name="openSUSE.org">
<title>Remote OBS instance</title>
<description>This project is representing a remote build service instance.</description>
<remoteurl>https://api.opensuse.org/public</remoteurl>
</project>

0 comments on commit aebc444

Please sign in to comment.