Skip to content
Snippets Groups Projects
Commit e3ed7533 authored by ale's avatar ale
Browse files

Merge branch 'master' into 'master'

Minor fixes on test instance

See merge request !1
parents 45da127c 630a8871
Branches
No related tags found
No related merge requests found
......@@ -48,8 +48,12 @@ func (afs *ByArtistFilesystem) Stat(path string) (Attr, error) {
if len(p) == 3 {
return afs.getSong(p[0], p[1], p[2])
} else if len(p) < 3 {
name := "/"
if len(p) > 0 {
name = p[len(p)-1]
}
attr := Attr{
Name: p[len(p)-1],
Name: name,
IsDir: true,
}
return attr, nil
......
......@@ -24,16 +24,16 @@ generate_server_conf() {
cat >$1 <<EOF
{
"db_path": "${root}/djrandom.db",
"db_addr": "localhost:3007",
"db_addr": "127.0.0.1:3007",
"storage_root": "${root}/fs",
"storage_pmap": "${root}/part.json",
"storage_self": "http://localhost:3003",
"storage_self": "http://127.0.0.1:3003",
"storage_key_id": "abcdef",
"storage_key_secret": "123456",
"index_pmap": "${root}/part-index.json",
"index_self": "localhost:3002",
"index_self": "127.0.0.1:3002",
"index_file": "${root}/djindex",
"task_server_addr": "http://localhost:3005",
"task_server_addr": "http://127.0.0.1:3005",
"last_fm_api_key": "1234"
}
EOF
......@@ -44,7 +44,7 @@ generate_client_conf() {
{
"music_dir": "${music_dir}",
"db_path": "${root}/djclient.db",
"server": "http://localhost:3001",
"server": "http://127.0.0.1:3001",
"auth_key": "${auth_key}",
"auth_secret": "${auth_secret}"
}
......@@ -52,17 +52,19 @@ EOF
}
generate_storage_part() {
${bindir}/parttool --parts=16 --file=$1 create http://localhost:3003
${bindir}/parttool --parts=16 --file=$1 create http://127.0.0.1:3003
}
generate_index_part() {
${bindir}/parttool --parts=16 --file=$1 create localhost:3002
${bindir}/parttool --parts=16 --file=$1 create 127.0.0.1:3002
}
start_daemons() {
for d in $DAEMONS ; do
local pidfile=${root}/${d}.pid
${bindir}/${d} --config=${root}/djrandom.conf --pid-file=${pidfile} &
local logfile=${root}/${d}.log
${bindir}/${d} --config=${root}/djrandom.conf --pid-file=${pidfile} \
--log-file=${logfile} &
done
}
......@@ -100,6 +102,11 @@ run_mr_stats() {
| ${bindir}/mr_stats --config=${root}/djrandom.conf --mapreduce
}
run_mr_davfs() {
${bindir}/mr_dump_bucket --config=${root}/djrandom.conf --bucket=song \
| ${bindir}/mr_davfs --config=${root}/djrandom.conf --mapreduce
}
setup
start_daemons
sleep 1
......@@ -111,6 +118,7 @@ echo ${root}
sleep 1
run_client
run_mr_stats
run_mr_davfs
echo "*** TEST COMPLETE ***"
echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment