Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created August 9, 2013 21:23
Show Gist options
  • Save chmouel/6197349 to your computer and use it in GitHub Desktop.
Save chmouel/6197349 to your computer and use it in GitHub Desktop.
Random swift tests I am using when reviewing stuff.
#!/bin/bash
echo $RANDOM > /tmp/a.txt
echo $RANDOM > /tmp/b.txt
eval $(ks -s localhost demo:demo ADMIN)
swift post testbulk >/dev/null
swift upload testbulk /tmp/{a,b}.txt >/dev/null
curl -i -H 'Content-Type: text/plain' -H "x-auth-token: ${TOKEN}" -X DELETE ${STORAGE_URL}/testbulk\?bulk-delete -d 'testbulk/tmp/a.txt'
#!/bin/bash
eval $(ks -s)
mkdir -p /tmp/tarball/{foo,bar}
echo $RANDOM > /tmp/tarball/foo/a.txt
echo $RANDOM > /tmp/tarball/bar/b.txt
cd /tmp/tarball
tar -cf /tmp/example.tar *
curl -H "x-auth-token: ${TOKEN}" -i -X PUT ${STORAGE_URL}/?extract-archive=tar --data-binary @/tmp/example.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment